WeixinJSBridge不是内置在微信浏览器的么。
不需要引用js,但是你要这么写:
if (typeof WeixinJSBridge == "undefined") {if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', wxPayCall, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', wxPayCall);
document.attachEvent('onWeixinJSBridgeReady', wxPayCall);
}
}
你要在注册一下WeixinJSBridgeReady这个事件
温馨提示:答案为网友推荐,仅供参考
第1个回答 2018-04-05
不需要引用js,但是你要这么写:
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', wxPayCall, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', wxPayCall);
document.attachEvent('onWeixinJSBridgeReady', wxPayCall);
你要在注册一下WeixinJSBridgeReady
不需要引入js
现在已经被禁用了
function weixinShareTimeline(title,desc,link,imgUrl)
WeixinJSBridge.invoke('shareTimeline',
"img_url":imgUrl,
//"img_width":"640",
//"img_height":"640",
"link":link,
"desc": desc,
"title":title