Skip to content

Instantly share code, notes, and snippets.

@oyvindkinsey
Forked from anonymous/server param.js
Created August 1, 2012 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oyvindkinsey/3229822 to your computer and use it in GitHub Desktop.
Save oyvindkinsey/3229822 to your computer and use it in GitHub Desktop.
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src =
('//' + /(www|apps)\.([\w\.]+\.)facebook\.com/.exec(document.referrer)
? RegExp.$2 + '.facebook.com/assets.php/en_US/'
: 'connect.facebook.net/en_US/') +
// the module to load
'all.js';
ref.parentNode.insertBefore(js, ref);
}(document));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment