0

Hello,

I am having coding error since my client fb_profile_image uses d'Fiens (this ' mark).

How to change my script so that the error disappears? It causes my rotary menu disappears?

http://dfiens-sewncraft.com/

 profile_image = '<div id="fb_profile_image"><img onclick="showProfileInfo(this)" data-name="d'Fiens Sew N Craft" data-first_name="d'Fiens" data-last_name="Sew N Craft" data-email="percapolkadot@gmail.com" data-url="https://www.facebook.com/app_scoped_user_id/1692543144123148/" data-about="" data-gender="female" data-location="" src="https://graph.facebook.com/1692543144123148/picture?type=normal"/></div>';
2
Contributors
2
Replies
18
Views
6 Days
Discussion Span
Last Post by diafol
0

Example:

var dataName = "d'Fiens Sew N Craft";
var dataFirstName = "d'Fiens";
var dataLastName = "Sew N Craft";
var dataEmail = "percapolkadot@gmail.com";
var dataURL = "https://www.facebook.com/app_scoped_user_id/1692543144123148/";
var dataAbout = "";
var dataGender = "female";
var dataLocation = "";
var src = "https://graph.facebook.com/1692543144123148/picture?type=normal";

var profile_image = '<div id="fb_profile_image"><img onclick="showProfileInfo(this)" data-name="'+dataName+'" data-first_name="'+dataFirstName+'" data-last_name="'+dataLastName+'" data-email="'+dataEmail+'" data-url="'+dataURL+'" data-about="'+dataAbout+'" data-gender="'+dataGender+'" data-location="'+dataLocation+'" src="'+src+'" /></div>';

Else, just escape all single quotes (or apostraphes) with a backslash - easier:

var profile_image = '<div id="fb_profile_image"><img onclick="showProfileInfo(this)" data-name="d\'Fiens Sew N Craft" data-first_name="d\'Fiens" data-last_name="Sew N Craft" data-email="percapolkadot@gmail.com" data-url="https://www.facebook.com/app_scoped_user_id/1692543144123148/" data-about="" data-gender="female" data-location="" src="https://graph.facebook.com/1692543144123148/picture?type=normal"/></div>';
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.