function callAndroid(obj){ meetfitjs.callShareSdk(JSON.stringify(obj)); } function callShareSdk() { test.hello(JSON.stringify(obj)) } function testDemo(obj) { var u = navigator.userAgent; if (u.indexOf(‘Android‘) > -1 || u.indexOf(‘Adr‘) > -1) { callAndroid(obj) } else if (!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) { window.webkit.messageHandlers.callShareSdk.postMessage({body: JSON.stringify(obj)}) } }
原文地址:https://www.cnblogs.com/wurui-0922/p/10172472.html
时间: 2024-10-22 13:09:42