【发布时间】:2010-05-18 01:26:53
【问题描述】:
我正在尝试在我的网站上实现类似 facebook 的按钮。 代码中的前四行已经在我的网站上“”标签的末尾。
为了实现“点赞按钮”,我添加了第二个脚本(第五行到最后) 并运行应用程序。它给了我一个错误
"Microsoft Jscript 运行时错误:'_onLoad' 为 null 或不是对象"
请告诉我。谢谢
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
FB.init("myapikey", "xd_receiver.htm", { "reloadIfSessionStateChanged": true });
</script>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: 'myappid', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
参考资料: http://developers.facebook.com/docs/reference/plugins/like
<fb:like href="http://webclip.in" layout="standard" show-faces="true" width="450" action="like" font="arial" colorscheme="light"/>
【问题讨论】: