Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
57
rated 0 times [  64] [ 7]  / answers: 1 / hits: 5069  / 11 Years ago, tue, december 3, 2013, 12:00:00

I'm trying to build a customized share button for Facebook using the script sharer.php with something like this:



<html>
<head>
<script type=text/javascript>
window.onload = function () {
var button = document.getElementById(share);

button.onclick = function() {
var title = encodeURIComponent('My title');
var summary = encodeURIComponent('My message');
var url = encodeURIComponent('https://www.mysite.com/foo');
var image = encodeURIComponent('https://pics.mysite.com/mylogo.png');

window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=' + title + '&amp;p[summary]=' + summary + '&amp;p[url]=' + url + '&amp;p[images][0]=' + image,'sharer','toolbar=0,status=0,width=548,height=325');
}
}
</script>
</head>
<body>
<input type=button id=share value=Share />
</body>
</html>


When I click the button, the Facebook login and share windows open, but the share window only shows a warning about some people not being able to see the post because of its privacy settings. I verified that there is nothing wrong with those settings. However, when I eventually try to share I get the error The message could not be posted to this Wall.



What am I doing wrong?


More From » facebook

 Answers
2

Turns out there is nothing wrong with this approach. After upgrading from node.js/express 2 to express 3 everything works just fine.


[#49879] Tuesday, December 3, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dawnc

Total Points: 612
Total Questions: 94
Total Answers: 98

Location: Sweden
Member since Fri, Apr 16, 2021
3 Years ago
;