-
-
Save aseemk/b14fdf40a5a73b4e2c4b to your computer and use it in GitHub Desktop.
Facebook comments, prevent mobile version on iPad
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
<div class="fb-comments" data-num-posts="5"><!-- other data- attributes as desired --></div> | |
<script> | |
if (navigator.userAgent.match(/\biPad\b/)) { | |
document.querySelector(".fb-comments") | |
.setAttribute("data-mobile", "false"); | |
} | |
</script> | |
<div id="fb-root"></div> | |
<script>(function(d){ | |
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;} | |
js = d.createElement('script'); js.id = id; js.async = true; | |
js.src = "//connect.facebook.net/en_US/all.js#appId=__YOUR_APP_ID_HERE__&xfbml=1"; | |
d.getElementsByTagName('head')[0].appendChild(js); | |
}(document));</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment