Home  >  Article  >  Web Front-end  >  Detailed introduction about window.history

Detailed introduction about window.history

巴扎黑
巴扎黑Original
2017-06-10 17:17:453164browse

The window object in DOM provides reading of browser history through the window.history method, allowing you to move forward and backward in the user's access record. Starting with HTML5, we can start manipulating this history stack. 1. History uses the back(), forward(), and go() methods to move forward and backward in the user's history. Forward and backward: window.history.back(); This method will appear as if the user clicked on the browser tool. Same as the return key on the bar. Similarly, you can also use the following method to generate user forward behavior: window.history.forward(); move to a specific position in the history. You can use the go() method to load a specific page from the session history. Move one page backward: window.history.go(-1); Move one page forward: window.history.go(1); Similarly, you can move forward or back multiple pages. You can also find the total number of pages in the history stack by checking the length property of the browser history. va

1. 6 recommended courses about replaceState

Detailed introduction about window.history

##Introduction: The window object in the DOM provides reading of browser history through the window.history method, allowing you to move forward and backward in the user's access record. Starting with HTML5, we can start manipulating this history stack. 1. History uses the back(), forward(), and go() methods to move forward and backward in the user's history. Forward and backward: window.history.back(); This method will appear as if the user clicked on the browser tool. Same as the return key on the bar. Same...

2. Usage of window.history in js (2)

Detailed introduction about window.history

Introduction: Window.history saves the user's website access record during a session. A new history record is created every time the user accesses a new URL. history.go(), history.back(), history.forward()history.back() and history.forward() represent one page backward and one page forward respectively. history.go(num) indicates how many pages to turn forward or backward. If num is a positive number, it means turning forward, and if it is a negative number, it means turning backward.

3. In-depth understanding of the history features in h5--pushState, replaceState

Detailed introduction about window.history

##Introduction: The window object in the DOM provides reading of browser history through the window.history method, allowing you to move forward and backward in the user's access record. Starting with HTML5, we can start manipulating this history stack.

4.

Usage of window.history in js (1)

Detailed introduction about window.history

Introduction: Window.history saves the user's website access record during a session. A new history record is created every time the user accesses a new URL. history.go(), history.back(), history.forward()history.back() and history.forward() represent one page backward and one page forward respectively. history.go(num) indicates how many pages to turn forward or backward. If num is a positive number, it means turning forward, and if it is a negative number, it means turning backward.

5.

Click back on the JQ page and a prompt box will pop up

Detailed introduction about window.history##Introduction: demo.js jQuery(document).ready(function ($) { if (window.history && window.history.pushState) { $(window).on('popstate', function ( ) { var hashLocation = location.hash; var hash...

6.

php method to get the value with & in the url parameter_PHP tutorial

Introduction: PHP method to get the value with & in the url parameter. In fact, during the project, we often encounter the path to get the address of the previous page. You can return to the previous page. Use the copied code code as follows: scriptwindow.history.go(-1);/script this

7. The problems related to js client php are a bit difficult

Introduction: The problems related to js client php are a bit difficult PHP code wc();//is a data insertion custom function echo "<script>if(confirm('Is the data parsed by the program correct? Confirm it will be inserted into the database. If there is an error, please cancel this operation and re-edit the excel file.')){}else{window.history.go (-1);}</script>"

##8. js client php related issues are a bit difficult

Introduction: The problem with js client php is a bit difficult PHP codewc();//It is a custom function for data insertion echo "<script>if(confirm('Is the data parsed by the program correct? Are you sure it will be inserted into the database If there is an error, please cancel this operation and re-edit the excel file.')){}else{window.history.go(-1);}</script>";/

9. php method to get the value with & in the url parameter

##Introduction: The method of php getting the value with & in the url parameter is actually. During the project, we often encounter the path to get the address of the previous page. You can return to the previous page and use the copied code as follows: scriptwindow.history.go(-1);/script this

10.

How to use the javascript history object (history record) (to realize the browser forward and backward)_Basic knowledge

Introduction: This article mainly introduces How to use the window.history object

[Related Q&A recommendations]:

angular.js - ui-router Return to the previous route

javascript - How to solve the problem that the window.history of some versions of android webview does not record hash changes?

##javascript - Is there any way to return to the previous one in js? The page does not refresh code

javascript - How to go to the WeChat interface

##javascript - A is the login page; B is the personal page from A. After logging in, the page jumps to page B. How can I not return to the login page?

The above is the detailed content of Detailed introduction about window.history. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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