Joke Collection Website - Cold jokes - How to share content with friends through js code in web pages?
How to share content with friends through js code in web pages?
the WeixinJSBridge object has been added to the built-in browser of wechat, and the content can be shared with friends through the cited object, so the following code is only valid in the built-in browser of wechat. var? shareToWeixinFriend? =? function(data,? cb)
{
if? (typeof? WeixinJSBridge? ==? 'undefined')? {
return? false;
}
else? {
WeixinJSBridge.invoke('shareTimeline',? {
'img_url':? data.imgurl? ||? '',? //? Image url address
'link':? data.url,? //? The address of the article. After sharing this content in the circle of friends, you can click to jump to this address
'desc':? data.desc,
'title':? data.title
},? function(d)? {
//? Returns the value of res.err_msg, and another attribute of d is err_desc
//? share_timeline:cancel? User canceled
//? Share_timeline:fail sending failed
//? share_timeline:confirm? Sending succeeded
WeixinJSBridge.log(d.err_msg);
cb? & & ? cb(d.err_msg);
});
}
return? false;
}
In addition, in the built-in browser of WeChat, you can directly view the information of a micro signal through the weixin:// link, for example: < a? href="weixin://profile/gh_9261dce78e9f"> Dig a joke <; /a>
where gh_9261dce78e9f is a micro signal.
- Related articles
- When chickens talk to cows, do they mean the same as ducks?
- 20 18 Forbes jokes
- What's the live broadcast?
- How to cook iron triangle monitor headphones?
- If the criminal refuses to admit it and there is no evidence, does this mystery never exist?
- Yan Yan's figure is impeccable. She used to be a beautiful actress in the school flower. Do you know anyone?
- Section introduction of Dahu Forum
- Why do you say that Ma Yun and Wang Jianlin will lose 100 million yuan in the future gambling business?
- Ancient classic joke stories
- Humorous jokes to coax girls (jokes that make girls happy)