Created
January 17, 2017 04:33
-
-
Save alexdeborba/cbeb262deec58a0871d652e77fc8945f to your computer and use it in GitHub Desktop.
Load Facebook Like Box Asynchronously
This file contains 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 characters
<?php | |
function fb_js() { | |
if(self::$script_loaded == 1) return; | |
self::$script_loaded = 1; | |
echo ' | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.async = true; | |
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4"; | |
fjs.parentNode.insertBefore(js, fjs); | |
} | |
(document, "script", "facebook-jssdk"));</script> | |
'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment