secret
Created

Facebook comments, prevent mobile version on iPad

  • Download Gist
index.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<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>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.