history.pushState

In this chapter you will learn:

  1. How to use pushstate method from history

Push state to history

history.pushState adds an Entry to the Browser History.

<!DOCTYPE HTML> <!--from  java  2s .  co m-->
<html> 
    <body> 
        <script type="text/javascript"> 
             window.history.pushState("", "", "?asdf"); 
        </script>
    </body>
</html>

Click to view the demo

Next chapter...

What you will learn in the next chapter:

  1. Get to know Location object
Home » Javascript Tutorial » History
History Object
history.back()
history.forward
history.go(url/number)
history.length
history.pushState