我正在尝试将不同图片的图片位置更改为分享按钮,这可以吗?或者有更好的方法吗?请告诉我从哪里开始使用function(){,我是javascript的新手,几天前寻找解决方案但是......
我的代码在下面显示
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'appid',
xfbml : true,
version : 'v2.0'
});
FB.ui(
{
method: 'feed',
name: 'The Facebook SDK for Javascript',
caption: 'Bringing Facebook to the desktop and mobile web',
description: (
'A small JavaScript library that allows you to harness ' +
'the power of Facebook, bringing the user\'s identity, ' +
'social graph and distribution power to your site.'
),
link: 'https://developers.facebook.com/docs/reference/javascript/',
picture: 'http://www.fbrell.com/public/f8.jpg'
},
function(response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
}
);
};
(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";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
和我的图片代码
<img src="uploads/intro/item01.png" width="65%" style="margin-top: 40px; margin-left: 18px;border-bottom: 1px dashed rgba(255, 255, 255, 0.28);padding-bottom: 15px;" onclick="postToFeed()" >