Reputation: 11
I am about to launch an iOS app which creates personalised mp3s and delivers them by means of a CDN-hosted web page. eg: http://bit.ly/Si771b
I am using the XFBML code from http://developers.facebook.com/docs/reference/plugins/like/ as that's the only one which can default the 'liked' page to the current one.
The 'like' button mostly does not load on the first attempt. If you keep refreshing you generally get it, but of course users won't know that. Can anyone shed light on why this may be?
Upvotes: 0
Views: 136
Reputation: 4634
try this:
if (typeof(FB) != 'undefined' && FB != null ) {
FB.XFBML.parse();
}
Upvotes: 1
Reputation: 103837
It seems you have a race condition in your logic somewhere. When the Like button fails to appear, I get the following error in the console:
FB.getLoginStatus() called before calling FB.init().
and so the page still contains an <fb:like>
tag, instead of this being expanded into the iframe containing the Like button.
As the error implies, you'll need to call FB.init()
before FB.getLoginStatus()
.
(You really ought to have looked for errors in the Javascript console when you had a problem with Javascript...)
Upvotes: 0