0

Hi there,

I have been told I need to use escape() and unescape() to fix some issues I am having with my Javascript in IE7. I've been fiddling with it for two days now and can't seem to get it working correctly. It would be amazing if someone on here could spare a few minutes to tell me what my code should look like.

Here's my Javascript (I've removed my efforts at escaping and unescaping, and also blanked my Facebook app ID out with 123456789):

<script>
         FB.init({ 
            appId:'123456789', cookie:true, 
            status:true, xfbml:true 
         });

function shareProduct(captionvar, descriptionvar, picturevar) {
 
         FB.ui({ method: 'feed',  
			link: 'http://www.facebook.com/rjthompsonmusic?sk=app_123456789',
			name: 'RJ Thompson Official Facebook Store',
			caption: captionvar,
			description: descriptionvar,
			picture: picturevar
            });
}
</script>

And here is how it is being called:

<a href="#" onclick="shareProduct('Illogical Life - Digital Download', 'RJ Thompsons 2006 album &quot;Illogical Life&quot; available for Digital Download from his Facebook Store. Includes the single &quot;Green Eyed&quot;, live favourites &quot;Jester&quot; and &quot;Piano Song&quot;, and 8 more original tracks. Only &pound;7.49!', 'http://www.rjthompsonmusic.com/facebook/illogical_life_270.jpg')">
Facebook</a>

Would really appreciate any help with this.

Many thanks,


Chris

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by twiss
0

Could you try it without the html entities, and also, try to register a handler within you script tag, it's more readable and handy for the quotes.

<script>
FB.init({
	appId: '123456789',
	cookie: true,
	status: true,
	xfbml: true 
});
function shareProduct(captionvar, descriptionvar, picturevar) {
	FB.ui({
		method: 'feed',  
		link: 'http://www.facebook.com/rjthompsonmusic?sk=app_123456789',
		name: 'RJ Thompson Official Facebook Store',
		caption: captionvar,
		description: descriptionvar,
		picture: picturevar
		});
}
document.getElementById('some_a_tag_id').onclick = function() {
	shareProduct(
		'Illogical Life - Digital Download',
		'RJ Thompsons 2006 album "Illogical Life" available for Digital Download from his Facebook Store. Includes the single "Green Eyed", live favourites "Jester" and "Piano Song", and 8 more original tracks. Only £7.49!',
		'http://www.rjthompsonmusic.com/facebook/illogical_life_270.jpg'
		);
};
</script>

Edited by twiss: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.