WeChat sharing it's so easy

Source: Internet
Author: User
1. After configuring the required sharing interface ():
Configuration:
Wx.config ({
Debug:true,///Open debug mode, call the return value of all the API will be on the client alert out, to see the incoming parameters can be opened on the PC side, the parameter information will be typed through log, only on the PC side will be printed.
AppId: ",//required, unique identification of the public number
Timestamp:,//required, time stamp for signature generation
NONCESTR: ',//required, generate a random string of signatures
Signature: ',//required, signature, see Appendix 1
Jsapilist: []//required, need to use the JS interface list, all JS interface list See Appendix 2 here to add the interface you need
});
----------------------------------------------------
Wx.ready (function () {
Share to Friends
Wx.onmenushareappmessage ({
Title: ",//share title
Desc: ",//Share description
Link: ",//Share Link
Imgurl: ",//Share icon
Type: ' link ',//share types, music, video or link, do not fill in the default link
Dataurl: ',//if type is music or video, provide data link, default is empty
Success:function () {
callback function that is executed after the user confirms the share
Alert (' Thank you for sharing ');
},
Cancel:function () {
Callback functions executed after the user cancels the share
Alert (' Why do you cancel sharing ');
}
});
Share to a circle of friends
Wx.onmenusharetimeline ({
Title: ",//share title
Desc: ",
Link: ",//Share Link
Imgurl: ",//Share icon
Success:function () {
callback function that is executed after the user confirms the share
/* Ajax processing in this position */

},
Cancel:function () {
Callback functions executed after the user cancels the share
Alert (' Why do you cancel sharing ');
}
});
});

The above describes the sharing is so simple, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

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