Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 9. Changing Browser History > Beginner Recipe: Adding to History with p...

Beginner Recipe: Adding to History with pushState

You use the pushState method of the History API to add a new entry into the browser session stack by the current page in the browser. The method takes two parameters, data and title, with an optional third parameter of url:

history.pushState(data, title [,url])


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial