history.pushState:Adding an Entry to the Browser History

Adding an Entry to the Browser History

 
<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title> 
    </head> 
    <body> 
        <script type="text/javascript"> 
             window.history.pushState("", "", "?asdf"); 
        </script>
    </body>
</html>
  
Click to view the demo
Home 
  JavaScript Book 
    DOM  

History:
  1. The History Object
  2. history.back()
  3. history.forward()
  4. history.go(url/number)
  5. history.length
  6. history.pushState:Adding an Entry to the Browser History