主页 > 前端 > javascript >
来源:未知 时间:2016-07-07 18:08 作者:xxadmin 阅读:次
[导读] 隐藏微信中网页右上角按钮 functiononBridgeReady(){WeixinJSBridge.call(hideOptionMenu);}if(typeofWeixinJSBridge==undefined){if(document.addEventListener){document.addEventListener(WeixinJSBridgeReady,onBridgeReady,false);}elseif(d...
隐藏微信中网页右上角按钮 function onBridgeReady(){ WeixinJSBridge.call('hideOptionMenu'); } 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(); } //返回说明 //隐藏底部导航栏没有返回值。(需要显示请把hideOptionMenu换成showOptionMenu) 隐藏微信中网页底部导航栏 function onBridgeReady(){ WeixinJSBridge.call('hideToolbar'); } 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(); } //返回说明 //隐藏底部导航栏没有返回值。(需要显示顶部导航栏,请把hideToolbar换成showToolbar) 网页获取用户网络状态 function onBridgeReady(){ WeixinJSBridge.invoke('getNetworkType',{}, function(e){ WeixinJSBridge.log(e.err_msg); }); } 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(); } //返回说明 //获取用户网络状态的返回值如下: //network_type:wifi wifi网络 //network_type:edge 非wifi,包含3G/2G //network_type:fail 网络断开连接 //network_type:wwan(2g或者3g) 关闭当前网页窗口 WeixinJSBridge.invoke('closeWindow',{},function(res){ //alert(res.err_msg); }); //关闭成功返回“close_window:ok”,关闭失败返回“close_window:error” 关闭当前浏览器内置函数:WeixinJSBridge.call('closeWindow'); |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com