I am trying to include Facebook’s Javascript SDK (the all.js file from http://connect.facebook.com/en_US/all.js) dynamically vis javascript for my web app. I have used the following code.
$.getScript('http://connect.facebook.com/en_US/all.js', function() {
alert('Facebook script has loaded');
});
When this is executed, currently I find that the page never alerts. My main aim is to load the Facebook JS SDK programatically. Kindly let me know if there is something wrong in what I am doing or is there any other way to achieve it.
The url is wrong, change to:
Also see this jsfiddle.