Skip to content

Instantly share code, notes, and snippets.

@karok
Created September 5, 2013 15:17
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 karok/6451577 to your computer and use it in GitHub Desktop.
Save karok/6451577 to your computer and use it in GitHub Desktop.
Facebook + Tripadvisor Widget - loading FB later. Problem with Tirpadvisor - not appearing http://www.juicy-blue.com/testingFB.html
<html>
<head>
</head>
<body>
<h1>TripAdv Reviews</h1>
<div id="TA_cdswritereviewlg881" class="TA_cdswritereviewlg">
<ul id="wBZd5AdA" class="TA_links qq8lzxFil3wz">
<li id="d5DMwddV" class="MNvEMl6cx2Pp">Review <a href="http://www.tripadvisor.co.uk/Hotel_Review-g189121-d1154914-Reviews-GoodFeeling_Hostel-Sagres_Faro_District_Algarve.html">GoodFeeling Hostel</a></li>
</ul>
</div>
<script src="http://www.jscache.com/wejs?wtype=cdswritereviewlg&amp;uniq=881&amp;locationId=1154914&amp;lang=en_UK&amp;border=false"></script>
<h1>Facebook LIke Button</h1>
<div id="addFBlikeButton"></div>
<h1>Facebook LIke Box</h1>
<div id="facebook-tripadvisor-boxen"></div>
<!-- Facebook später laden -->
<!-- Facebook später laden -->
<script>
window.onload = function(){
var wait = 1000; // 3s
var btn = document.getElementById('addFBlikeButton');
var btn2 = document.getElementById('facebook-tripadvisor-boxen');
setTimeout(function(){
// FACEBOOK LIKE BUTTON
var add = document.createElement('div');
add.innerHTML = '<div class="fb-like" data-href="https://www.facebook.com/hostel.goodfeeling" data-send="true" data-layout="box_count" data-width="55" data-show-faces="false" data-font="arial"></div><div id="fb-root"></div>';
btn.appendChild(add);
// FACEBOOK BOX
var add2 = document.createElement('div');
add2.innerHTML = '<div class="fbbox"><span class="findusFB">Find us on Facebook</span><div class="fb-like-box" data-href="https://www.facebook.com/hostel.goodfeeling" data-width="292" data-show-faces="true" data-stream="true" data-show-border="false" data-header="false"></div></div>';
btn2.appendChild(add2);
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=122879067810437";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}, wait);
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment