Hello Everyone!!
Javascript can manipulate the browser history with the help of the some inbuilt function.The DOM window object can access the the history with the history function.. It exposes useful methods and properties that let you move back and forth through the user's history. the history provides some inbuilt method for manipulating with the history.
Here are some method provided by window.history:
1) For Moving Backward:-
window.history.back();
2) For Moving Forward:-
window.history.forward();
3) Moving to a specific point in history:
window.history.go(n);
4) You can determine the number of pages in the history stack by looking at the value of the length property:
var numberOfEntries = window.history.length;
5) We can add and modifies the history entries by using some methods:
-
var currentState = history.state;
-
history.pushState(stateObj, "a", "c.html");
-
history.replaceState(arg1 arg2 arg3);
0 Comment(s)