问题描述
我想实现我的网站的Facebook像按钮。
前四行在code是已经存在的标记结束后,我的网站。
要贯彻落实Like按钮我已经添加了第二个脚本(五号线为末)
并运行应用程序。它给我一个错误
微软的Jscript运行时错误:'_的onLoad'为空或不是对象
请让我知道。谢谢
<脚本类型=文/ JavaScript的SRC =http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js .PHP>< / SCRIPT>
<脚本类型=文/ JavaScript的>
FB.init(myapikey,xd_receiver.htm,{reloadIfSessionStateChanged:真正});
< / SCRIPT>
<脚本类型=文/ JavaScript的>
window.fbAsyncInit =功能(){
FB.init({APPID:myappid',状态:真的,饼干:真实,
XFBML:真});
};
(函数(){
变种E =使用document.createElement('脚本'); e.async = TRUE;
e.src = document.location.protocol +
//connect.facebook.net/en_US/all.js';
的document.getElementById('FB-根')的appendChild(E)。
}());
< / SCRIPT>
参考:
< FB:像HREF =http://webclip.in布局=标准显示,面孔=真WIDTH =450行动=喜欢字体=宋体色彩方案=轻/>
有一种新的方式以增加您网站上的类似按钮。
到这个网页,
和plasing您的参数应用创建code和点击获取code
这是一个例子。
< IFRAME
src=\"http://www.facebook.com/plugins/likebox.php?id=185550966885&width=292&connections=10&stream=true&header=true&height=587\"
滚动=无FRAMEBORDER =0
风格=边界:无;溢出:隐藏; WIDTH:292px;高度:587px; ALLOWTRANSPARENCY =真正的>
< / IFRAME>
或只是(如果你使用Facebook的Javascript的SDK)
< FB:像盒子PROFILE_ID =185550966885>< / FB:像盒>
在该页面还
有一个获取code ......这就是工作,无需添加你的code这个JavaScript。
I am trying to implement facebook like button on my website.The first four lines in the code is already there on my site after the end of the "" tag.
To implement the "Like button" i have added the second script (Line five to the end)and ran the application. Its giving me an error as
"Microsoft Jscript runtime error:'_onLoad' is null or not an object"
Please Let me know. Thanks
<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>
References: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"/>
There is a new way to add the like button on your site.
go to this page,http://developers.facebook.com/docs/reference/plugins/like-box
and create the code by plasing your parametres and click the "Get Code"
This is an example
<iframe
src="http://www.facebook.com/plugins/likebox.php?id=185550966885&width=292&connections=10&stream=true&header=true&height=587"
scrolling="no" frameborder="0"
style="border:none; overflow:hidden; width:292px; height:587px;" allowTransparency="true">
</iframe>
or just (if you using Javascript SDK of facebook)
<fb:like-box profile_id="185550966885"></fb:like-box>
Also in the pagehttp://developers.facebook.com/docs/reference/plugins/likethere is a Get Code... thats works, no need to add this javascript on your code.
这篇关于如何实现Facebook&QUOT;像&QUOT;按钮为我的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!