jquery跳转页面的方法:通过使用属性替换方法attr()或prop()来实现跳转,如【$(location).attr('href', 'url地址')】、【$(location).prop('href', 'url')】。
本教程操作环境:windows7系统、jquery3.3.1版,该方法适用于所有品牌电脑。
jquery跳转页面的方法有以下几种:
(学习视频分享:jquery视频教程)
1、利用http的重定向来跳转
window.location.replace("http://www.php.cn");
2、使用href来跳转
window.location.href = "http://www.php.cn";
3、使用jQuery的属性替换方法来实现跳转
$(location).attr('href', 'http://www.php.cn'); $(window).attr('location','http://www.php.cn'); $(location).prop('href', 'http://www.php.cn')
相关推荐:js教程
以上就是jquery中怎么跳转页面的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号