I am trying to implement the facebook like button feature on page for web app (no phonegap). When I try to view page, the button is not showing (div is empty on page source). When I refresh page, button shows. I am wondering what the problem might be. When I do get button to show, it works fine- posts to facebook.
Like button docs:
https://developers.facebook.com/docs/...
On page, I added two panels:
First panel at top of page called fbPanel contains code provided by facebook like button configurator:
code
<div id="fb-root"></div>
<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.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=may-app-id"
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
/code
The next panel where button is to be shown, showPanel is empty to start.
On the pageShow event I run this script:
var url = localStorage.getItem('currentPage');
var addedCode='';
Tiggzi('showPanel').append(addedCode):