Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of window.history.back () under Windows

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you "what is the use of window.history.back () under Windows". It is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "what is the use of window.history.back () under Windows".

Window.history.back () under Windows returns not only the status of the previous page but also the status of the previous page. If I change a page 3 times, I have to go back 3 times to get back to the previous page. And the deleted data in the database still feels very impractical when displayed on it.

Window.history.back () solution

Solution: add a reload () after history.back () so that you can go back to the refreshed page

That is: history.back (); location.reload (); if there is a frame, just put the frame name in front of it.

The window.history object contains browser history.

Window.history objects can be written without window.

To protect the privacy of users, there are restrictions on JavaScript's access to this object.

Some methods:

History.back ()-equivalent to clicking the back button in the browser

History.forward ()-equivalent to clicking the forward button in the browser

WindowHistoryBack

The history.back () method loads the previous URL in the history list.

This is equivalent to clicking the back button in the browser.

Case study

Create a back button on the page:

FunctiongoBack () {

Window.history.back ()

}

The output of the above code will be (please click this button):

WindowHistoryForward

The historyforward () method loads the next URL in the history list.

This is equivalent to clicking the forward button in the browser.

WindowHistoryback instance

Create a forward button on the page:

FunctiongoForward () {

Window.history.forward ()

}

The above is all the content of the article "what is the use of window.history.back () under Windows". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report