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("//m.sbmmt.com");
2. Use href to jump
window.location.href = "//m.sbmmt.com";
3. Use jQuery’s attribute replacement method to jump
$(location).attr('href', '//m.sbmmt.com'); $(window).attr('location','//m.sbmmt.com'); $(location).prop('href', '//m.sbmmt.com')
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!