非微信打开不显示页面

时间:2017-07-25 19:35:18   收藏:0   阅读:272
var useragent = navigator.userAgent;
if (useragent.match(/MicroMessenger/i) != ‘MicroMessenger‘) {
//来源不是微信则强行关闭页面
var opened = window.open(‘about:blank‘, ‘_self‘);
opened.opener = null;
opened.close();
}
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!