This time I will bring you the jQuery to do page jumps and the precautions for using jQuery to do page jumps. The following is a practical case, let’s take a look.
So, today we will talk about how to jump to another web page HTML in jQuery.
In fact, the several methods I listed below do not necessarily use jQuery, and some also use the native methods of Javascript, so it can be regarded as a summary of front-end jumps.
We can use http redirection to jump
window.location.replace("http://www.php.cn ");
Use href to jump
window.location.href = "http://www.php. cn";
Use jQuery's attribute replacement method
$(location).attr('href', 'http://www.jb51.net'); $(window).attr('location','http://www.jb51.net'); $(location).prop('href', 'http://www.jb51.net')
Finally, I wish everyone a happy day. No more
# I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
Use case of $(function() {}) in jQuery
jQuery operates html element click Detailed explanation of the incident
The above is the detailed content of Use jQuery to make page jumps. For more information, please follow other related articles on the PHP Chinese website!