In this JavaScript tutorial, we will learn History object and how one can use it to navigate the browsing history. You learn the forward, back and go functions of the History object in the video.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<!DOCTYPE html> <head> <Title> Java Script Windows </Title> </head> <body> <Script type="text/javascript"> function back() { window.history.back(); } function forward() { window.history.forward(); } function Goto() { var goto = document.getElementById("Go").value; goto = parseInt(goto); window.history.go(goto); } </Script> <input type="button" value="Back" onclick="back()" /> <input type="button" value="Forward" onclick="forward()" /> <p> Go to any visted Links. (+) Moves forward. (-) Moves backword </p> <input type="text" Id="Go" value="-2" /> <input type="button" value="goto" onclick="Goto()" /> </body> </html> |
Categories: JavaScript-Tube