-1
我需要在我的Facebook應用程序中使用圖像URL發佈圖像可能嗎? 如何在點擊按鈕後將圖像發佈到Facebook? 在可變圖像,由可變shareUrl facebook的URL我已存儲IMAGEURL,使用應用程序ID將圖像發送到Facebook應用程序
following is the complete facebook URL :
"https://www.facebook.com/dialog/feed?app_id=843228839026054&caption=example.com&display=popup&redirect_uri="+encodeURIComponent("http://www.facebook.com/")+"&name=%title%&description=%desc%&picture=%image%".
<html>
<head>
<script>
var doShare = function(title, description)
{
if(title && description)
{
image="http://www.sxc.hu/assets/182945/1829445627/small-flowers-1019552-m.jpg";
/* for readability i store the url like this, above this code u can find
the complete facebook url. */
shareUrl = "https://www.facebook.com/dialog/feed?";
shareUrl += "app_id=843228839026054&caption=example.com&display=popup&";
shareUrl += "redirect_uri="+encodeURIComponent("http://www.facebook.com/");
shareUrl += "&name=%title%&description=%desc%&picture=%image%";
var url = shareUrl.replace(/%title%/g, encodeURIComponent(title));
url = url.replace(/%desc%/g, encodeURIComponent(description));
url = url.replace(/%image%/g, encodeURIComponent(image));
var isOpen = window.open(url);
if(!isOpen)
{
console.log('Please turn off "Block pop up" setting to proceed further.');
}
}
};
</script>
</head>
<body>
<div id='share'>
<input type='button' onclick ='doShare("TITLE","DESCRIPTION")'>Share</input>
</div>
</body>
</html>