Home > Web Front-end > JS Tutorial > How to jump to the page in jquery

How to jump to the page in jquery

王林
Release: 2020-11-30 17:11:09
Original
10178 people have browsed it

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')】.

How to jump to the page in jquery

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");
Copy after login

2. Use href to jump

window.location.href = "//m.sbmmt.com";
Copy after login

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')
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template