function onBridgeReady() {
WeixinJSBridge.call('hideOptionMenu');
if (typeof onBridgeReadyCallback !== 'undefined' && typeof onBridgeReadyCallback === 'function') {
onBridgeReadyCallback();
}
}
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
}
} else {
onBridgeReady();
}
ios系统未执行函数onBridgeReadyCallback();
if (err == 1) {
alert(errmsg);
} else {
pay();
}
}
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if (isiOS) {
onBridgeReadyCallback();
}