任何显示加载图标或消息的简单方法,直到在页面上加载 Facebook 类似框。
并在页面上完全加载类似框后隐藏消息/图标。
折断:
代码:
<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=488390501239538";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
function TakePreview()
{
jQuery('#loadingmsg').show();
location.href = location.href;
}
<div id="previewfanbox">
<strong>Fanbox Widget Preview</strong><br>
<p id="loadingmsg" style="display:none;">Loading Like Box, please wait...</p>
<div class="fb-like-box" data-href="https://www.facebook.com/FacebookDevelopers" data-width="292" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true">
</div>
</div>
<input name="takepreview" id="takepreview" class="button" type="button" value="Refresh Preview" onclick="return TakePreview();"><br>
所以,请给我一个简单的方法或任何其他方法来实现这一点。谢谢小伙伴们!