http://www.mitbbs.com//article_t/BuildingWeb/31178709.html
发信人: beijing1 (北京), 信区: BuildingWeb
标 题: 微信链接指定图标的code,为什么不工作?
发信站: BBS 未名空间站 (Fri Sep 18 20:46:22 2015, 美东)
请教高手,这段小品到处分享,好像多数都工作,但我这里却不工作,有什么
猫腻吗? 先谢了!
<script>
var imgUrl = "http://xxx.xx.com/test.jpg";
var lineLink = "http://xxx.xx.com";
var descContent = 'test ';
var shareTitle = 'test';
var appid = '';
function shareFriend() {
WeixinJSBridge.invoke('sendAppMessage',{
"appid": appid,
"img_url": imgUrl,
"img_width": "200",
"img_height": "200",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function(res) {
})
}
function shareTimeline() {
WeixinJSBridge.invoke('shareTimeline',{
"img_url": imgUrl,
"img_width": "200",
"img_height": "200",
"link": lineLink,
"desc": descContent,
"title": shareTitle
}, function(res) {
});
}
function shareWeibo() {
WeixinJSBridge.invoke('shareWeibo',{
"content": descContent,
"url": lineLink,
}, function(res) {
});
}
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
WeixinJSBridge.on('menu:share:appmessage', function(argv){
shareFriend();
});
WeixinJSBridge.on('menu:share:timeline', function(argv){
shareTimeline();
});
WeixinJSBridge.on('menu:share:weibo', function(argv){
shareWeibo();
});
}, false);
</script>
--
评论
发表评论