When doing some complex javascript, using the standard Facebook plugins can really slow down and interfere with your script. To control when it loads and runs you can load it in manually like so (fadeTo function is an example only of organising timing):
FB.XFBML.parse() will then run through your HTML looking for plugins (you can specify a selector too) that it needs to activate.
$('.myelement').fadeTo(800, 1, function () {
PluginSetup();
});
function PluginSetup() {
$.ajaxSetup({ cache: true });
$('body').append('<div id="fb-root"></div>');
$.getScript('//connect.facebook.net/en_US/sdk.js', function () {
FB.init({
version: 'v2.4'
});
FB.XFBML.parse();
});
}
FB.XFBML.parse() will then run through your HTML looking for plugins (you can specify a selector too) that it needs to activate.
http://news.unair.ac.id/
ReplyDeletehttp://news.unair.ac.id/
niceee