Created
January 1, 2013 21:24
-
-
Save johnbacon/4430125 to your computer and use it in GitHub Desktop.
Revisions
-
johnbacon revised this gist
Jan 1, 2013 . 1 changed file with 18 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,19 @@ (function() { var url = '//connect.facebook.net/en_US/all.js'; var iframe = document.createElement('iframe'); (iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0"; iframe.src = "javascript:false"; document.getElementById('fb-root').appendChild(iframe); var doc = iframe.contentWindow.document; doc.open().write('<body onload="'+ 'window.inDapIF = true;' + 'var js = document.createElement(\'script\');'+ 'js.src = \''+ url +'\';'+ 'document.body.appendChild(js);">'); doc.close(); }()); // async init once loading is done window.fbAsyncInit = function() { FB.init({xfbml: true}); }; -
johnbacon created this gist
Jan 1, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ (function() { var url = '//connect.facebook.net/en_US/all.js'; var iframe = document.createElement('iframe'); (iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0"; iframe.src = "javascript:false"; document.getElementById('fb-root').appendChild(iframe); var doc = iframe.contentWindow.document; doc.open().write('<body onload="'+ 'window.inDapIF = true;' + 'var js = document.createElement(\'script\');'+ 'js.src = \''+ url +'\';'+ 'document.body.appendChild(js);">'); doc.close(); }()); // async init once loading is done window.fbAsyncInit = function() { FB.init({xfbml: true}); }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ (function(url){ // Section 1 var iframe = document.createElement('iframe'); iframe.src = "javascript:false"; (iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0"; var where = document.getElementsByTagName('script'); where = where[where.length - 1]; where.parentNode.insertBefore(iframe, where); // Section 2 var doc = iframe.contentWindow.document; doc.open().write('<body onload="'+ 'var js = document.createElement(\'script\');'+ 'js.id = \'js-iframe-async\';'+ 'js.src = \''+ url +'\';'+ 'document.body.appendChild(js);">'); doc.close(); })('http://some.site.com/script.js');