Definition and Usage Window History..
The window.history object contains the browsers history.
The window.history object can be written without the window prefix.
To protect the privacy of the users, there are limitations to how JavaScript can access this object.
Some methods:
Window History Back
The history.back() method loads the previous URL in the history list.
Window History Forward
The history forward() method loads the next URL in the history list
Differents way how to declare Window History in program.
CODING:The window.history object contains the browsers history.
The window.history object can be written without the window prefix.
To protect the privacy of the users, there are limitations to how JavaScript can access this object.
Some methods:
- history.back() - same as clicking back in the browser
- history.forward() - same as clicking forward in the browser
Window History Back
The history.back() method loads the previous URL in the history list.
Window History Forward
The history forward() method loads the next URL in the history list
Differents way how to declare Window History in program.
<html>
<head>
<script>
function backhi() {
window.history.back()
}
function forwardhi() {
window.history.forward()
}</script>
</head>
<body>
<button onclick="forwardhi()">Forward</button>
<button onclick="backhi()">Back</button>
</body>
</html>
<head>
<script>
function backhi() {
window.history.back()
}
function forwardhi() {
window.history.forward()
}</script>
</head>
<body>
<button onclick="forwardhi()">Forward</button>
<button onclick="backhi()">Back</button>
</body>
</html>
Comments
Post a Comment