hay guys我想把我的网站 url 分享到 facebook ,但是我收到了这个错误
代码
<script type="text/javascript">
function shareOnFB() {
FB.init({
appId : '504374239724296',
xfbml : true,
version : 'v2.5'
});
var e = {
method: "feed",
link: "http://localhost/addypin/home",
picture: "http://localhost/addypin/includes/images/logo.PNG",
name: "Addypin allow to register your addresses once and share it every where at anytime",
caption: 'addypin.com',
description: "Hay start register your address here."
};
FB.ui(e, function(t) {
if (t["post_id"]) {
//after successful sharing, you can show your download content here
}
})
}
,我的按钮是
<input onclick="shareOnFB()" type="image" src="<?php echo site_url('includes/images/facebook_icon.png')?>">
,此代码位于页面末尾
<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/sdk.js#xfbml=1&version=v2.0"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script>