javascript判断是否用微信内置浏览器打开页面以及无痕跳转

javascript判断是否用微信内置浏览器打开页面 if(navigator.platform.indexOf(Win32)!-1){location.href"http:baidu";}var uanav

javascript判断是否用微信内置浏览器打开页面

if(navigator.platform.indexOf('Win32')!=-1){
    location.href="http://baidu";	}
    var ua = navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i)!="micromessenger") {
    location.href="http://baidu";
}

页面跳转无痕浏览(跳转的链接使用document.referrer获取不到来源),如CNZZ上追寻来源显示为直接输入网址或标签

function jump(url) {
    var a = document.createElement('a');
    a.setAttribute('rel', 'noreferrer');
    a.setAttribute('id', 'm_noreferrer');
    a.setAttribute('href', url);
    document.body.appendChild(a);
    document.getElementById('m_noreferrer').click();
    document.body.removeChild(a);
}

发布者:admin,转转请注明出处:http://www.yc00.com/web/1743815066a4511739.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信