admin管理员组文章数量:1023848
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);
}
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);
}
版权声明:本文标题:javascript判断是否用微信内置浏览器打开页面以及无痕跳转 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/jiaocheng/1743815067a2034469.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论