Specific implementation of the facebook sharing function on the webpage

Source: Internet
Author: User

Copy codeThe Code is as follows:
<Span style = "font-family: Verdana, Arial, Helvetica, sans-serif; word-wrap: normal; word-break: normal; line-height: 19.5px; "> <span style =" word-wrap: normal; word-break: normal; line-height: 19px "> </span>

Digress: directly jump to the share button on the facebook login page:

Url: http://www.facebook.com/sharer.php? U = www.baidu.com & t = 123213123

Here, the u parameter is the link you want to share. The t parameter is not clear yet.

Facebook sharing:

Share page settings

1. A link: the parameter is the link of the page to be shared
Copy codeThe Code is as follows:
<A style = "display: inline-block; width: 35px; height: 40px; position: relative; top: 10px; left: 48px ;"
Title = "Share on Facebook" target = "_ blank"
Onclick = "javascript: window. open ('HTTP: // www.facebook.com/sharer.php? U = '+ encodeURIComponent ('https: // www.baidu.com') + '& t =' + encodeURIComponent (document. title), 'newwindow', 'width = 800, height = 400 ', 'center'); void (0); ">


2. fb tags:
Copy codeThe Code is as follows:
<Title> test </span> title>
<Meta property = "og: image" content = "test/test.jpg"/>
<Meta property = "og: description" content = "test>"/>
<Meta property = "og: url" content = "https://www.baidu.com"/>

Note:

1. title fb can automatically read the title of the page to be shared. This should be set in the sharer. php parameter of fb.
You can also set the method as follows:
Copy codeThe Code is as follows:
<Meta property = "og: title" content = "test"/>

2. The image tag can be written to multiple persons who share the image. You can select the image by yourself.

3. url is the page you want to share
4. description

Tip:

The image pixel must be 100*100. In this format, 90*90 is OK.

For example, if 300*100 150*50 is taken on www.facebook.com, The 90x90 image is incorrectly displayed.
If the picture is smaller, the pop-up box for sharing will not show your picture. This happens when the picture is smaller than 90x90.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.