Home >Web Front-end >JS Tutorial >How to jump to the page in jquery
Jquery method to jump to the page: Jump by using the attribute replacement method attr() or prop(), such as [$(location).attr('href', 'url address')], 【$(location).prop('href', 'url')】.
The operating environment of this tutorial: Windows 7 system, jquery version 3.3.1. This method is suitable for all brands of computers.
There are several ways to jump to a page using jquery:
(Learning video sharing: jquery video tutorial)
1. Use http redirection to jump
window.location.replace("http://www.php.cn");
2. Use href to jump
window.location.href = "http://www.php.cn";
3. Use jQuery’s attribute replacement method to jump
$(location).attr('href', 'http://www.php.cn'); $(window).attr('location','http://www.php.cn'); $(location).prop('href', 'http://www.php.cn')
Related recommendations: js tutorial
The above is the detailed content of How to jump to the page in jquery. For more information, please follow other related articles on the PHP Chinese website!