Facebook share button: how to implement

后端 未结 4 938
野性不改
野性不改 2020-12-16 20:13

I\'m trying to figure out how to implement the Share button exactly as how it is implemented here. I want the ability to let users post a given link to their news feed with

4条回答
  •  天涯浪人
    2020-12-16 20:14

    If you want to customize that share page, try this:

    Javascript Popup Example:

    var title = 'My Title';
    var summary = 'This is my summary';
    var url = 'http://www.mydomain.com/path/to/page';
    var image = 'http://www.mydomain.com/images/myimage.png';
    
    var fb = window.open('http://www.facebook.com/sharer.php?s=100&p[title]='+encodeURIComponent(title)+'&p[url]='+encodeURIComponent(url)+'&p[summary]='+encodeURIComponent(summary)+'&p[images][0]='+encodeURIComponent(image));
    fb.focus();
    

提交回复
热议问题