当前位置:首页 > CSS > 关键词 > jQuery > 正文

jQuery跳转页面的3种代码示例

jQuery跳转页面的3种代码示例

1.使用href来跳转

window.location.href = "http://www.zhimatong.com";

2.利用http的重定向来跳转

window.location.replace("http://www.zhimatong.com");

3.使用jQuery的属性替换方法来实现跳转

$(location).attr('href', 'http://www.zhimatong.com');

$(window).attr('location','http://www.zhimatong.com');

$(location).prop('href', 'http://www.zhimatong.com')

本文属原创,转载请注明原文:https://www.zhimatong.com/jiaocheng/924.html

为保证教程的实用性及扩大知识面覆盖,如果您有相似问题而未解决,可联系在线客服免费技术支持。

内容有用??