JavaScript-WeChat share forwarded to a friend, description is URL

Source: Internet
Author: User

Hopefully the result is this:

Now we have a self-adapting page, and the result is that when you turn this page forward to a friend, the title is displayed, but the picture and description are not displayed.

The online solution says:
The picture is larger than 300x300 and is the first one. But I can't guarantee that there are pictures in the content. So prepare the content without a picture, replace it with a default picture.

The description will be read as long as there is content in the meta description of the page. As below, no use.


  
   

Reply content:

Hopefully the result is this:

Now we have a self-adapting page, and the result is that when you turn this page forward to a friend, the title is displayed, but the picture and description are not displayed.

The online solution says:
The picture is larger than 300x300 and is the first one. But I can't guarantee that there are pictures in the content. So prepare the content without a picture, replace it with a default picture.

The description will be read as long as there is content in the meta description of the page. As below, no use.


  
   

Requires JSSDK, requires a small back-end partner to match

  wx.ready(function () {                       // 获取“分享到朋友圈”按钮点击状态及自定义分享内容接口                    wx.onMenuShareTimeline({                        title: "title", // 分享标题                        link:"url",                        imgUrl: "sharePic.jpg", // 分享图标                        success: function (res) {                        }                    });                                            // 获取“分享给朋友”按钮点击状态及自定义分享内容接口                    wx.onMenuShareAppMessage({                        title: "title", // 分享标题                        link:"url",                        imgUrl: "sharePic.jpg", // 分享图标                        desc: '描述', // 分享描述                        type: 'link', // 分享类型,music、video或link,不填默认为link                        success: function (res) {                        }                    });  });

Need to load Jweixin.js
The URL is as follows:
Http://qydev.weixin.qq.com/wiki/index.php?title=%E5%BE%AE%E4%BF%A1JS%E6%8E%A5%E5%8F%A3

Then call the share API below to share, the other ibid. I'm so lazy.

Need back-end mates, this is my previous BA la two simple demo:
Https://github.com/wjfz/weixin-jssdk

  • 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.