设为首页 - 加入收藏
广告 1000x90
您的当前位置:主页 > 微商引流 > 正文

jq页面跳转到新页面(js点击跳转到指定页面)

来源:引流技巧 编辑:引流技巧 时间:2026-04-30

>1.使用Jquery实现跳转

$(location).attr(\'href\',\"http://www.google.com\");$jq(window).attr(\"location\",\"http://www.google.com\");$(location).prop(\'href\',\"http://www.google.com\");

2.使用JavaScript实现跳转

// 相当于 HTTP redirectwindow.location.replace(\"http://stackoverflow.com\");// 相当于 clicking on a linkwindow.location.href = \"http://stackoverflow.com\";

JavaScript其它的可实现页面跳转的方式

window.history.back(-1);window.navigate(\"top.jsp\"); //old-ie-onlyself.location = \'top.jsp\';top.location = \'top.jsp\';window.location=window.locaiton.host;winodw.locaiton.assign(\'http://www.baidu.com\');ducument.location.href=\'/path\';window.history.go(-1);

3.页面跳转路径错误问题

ie8以下的页面跳转需要使用绝对路径,使用相对路径的时候ie会自动网跳转的Url上面加上当前页面的路径,这会导致跳转错误。 下面是解决办法:

function Redirect (url) { var ua = navigator.userAgent.toLowerCase(),
栏目分类

微商引流技巧网 www.yinliujiqiao.com 联系QQ:1716014443 邮箱:1716014443@qq.com

Copyright © 2019-2024 强大传媒 吉ICP备19000289号-9 网站地图 rss地图

Top