功能有两个:
1. 判断当前web页是不是在某个客户端内(客户端也是自己开发的)
2. 在客户端内的WebView调用JS来唤起客户端页面,用户做一系列操作后把结果返回给WebView的JS回调
类似微信接口:
WeixinJSBridge.invoke('editAddress',{ "appId" : getAppId(),
"scope" : "jsapi_address", "signType" : "sha1", "addrSign" : "xxxxx", "timeStamp" : "12345", "nonceStr" : "10000",
},function(res){
//若 res 中所带的返回值不为空,则表示用户选择该返回值作为收货地
址。否则若返回空,则表示用户取消了这一次编辑收货地址。 document.form1.address1.value =
res.proviceFirstStageName; document.form1.address2.value =
res.addressCitySecondStageName; document.form1.address3.value =
res.addressCountiesThirdStageName;
document.form1.detail.value = res.addressDetailInfo;
document.form1.phone.value = res.telNumber;
}); });
有什么好的方式实现?
1. 判断当前web页是不是在某个客户端内(客户端也是自己开发的)
2. 在客户端内的WebView调用JS来唤起客户端页面,用户做一系列操作后把结果返回给WebView的JS回调
类似微信接口:
WeixinJSBridge.invoke('editAddress',{ "appId" : getAppId(),
"scope" : "jsapi_address", "signType" : "sha1", "addrSign" : "xxxxx", "timeStamp" : "12345", "nonceStr" : "10000",
},function(res){
//若 res 中所带的返回值不为空,则表示用户选择该返回值作为收货地
址。否则若返回空,则表示用户取消了这一次编辑收货地址。 document.form1.address1.value =
res.proviceFirstStageName; document.form1.address2.value =
res.addressCitySecondStageName; document.form1.address3.value =
res.addressCountiesThirdStageName;
document.form1.detail.value = res.addressDetailInfo;
document.form1.phone.value = res.telNumber;
}); });
有什么好的方式实现?