In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the concept of JavaScript Window History". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the concept of JavaScript Window History".
I. Preface
Window.history objects can be written without the window window prefix. To protect the privacy of users, restricted JavaScript can access this object.
History.back ()-same as clicking the back button in the browser.
History.forward ()-same as clicking the forward button in the browser.
2. History object
The window.history object contains the browser session history, a list of all pages accessed in the current frame or window, and window.history can write objects without window prefixes.
However, in order to protect the privacy of users, there are some restrictions on how JavaScript accesses this object. The window.history object contains browser history.
3. Get the number of pages visited
This history.length property returns the number of pages in the current window in the browser session history, as well as the currently loaded pages.
Example
Var result = history.length; / / returns the size of the current session history complete code: project
Number of URL in the history list:
Note: this example opens in the new framework and will be treated as a new "session":
Var result = history.length; document.getElementById ("para") [xss_clean] = result
You can use this property to find out how many pages the user visited during the current browser session.
1. Return to the previous page
The history.back () method loads the previous URL in the history list.
This is the same as clicking the back button in the browser.
Project advance
Note: clicking the forward button here will not do anything because there is no next URL in the history list:
The above code displays the following output (this example will not work if the next page does not exist in the history list):
3. Go to a specific page
You can use the history.go () method to load a specific page from the session history.
This method takes an integer as a parameter, a negative integer moves backward in the history, and a positive integer moves backward in the history.
Example
Project
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.