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.