What is the use of window.history.back () under Windows
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!