来源: 最后更新:24-07-02 09:01:12
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(),
标签: [db:关键词]
彝海结盟结局 彝海结盟剧情1、拉铁,彝族武士。喜欢阿依诗薇,与刘天骏是情敌,后来成为红军的向
武汉体育金秋券定点商户名单2024 武汉体育中心2020年11月20日 2024五邑大学访客预约指南 五邑大学21年新生官方咨询群 2024五邑大学因公或因私事来访人员怎么预约进入?(附操作流程) 唐河县2024年春季禁渔期通告 南阳市唐河县禁渔