Using History API and Custom Data Attributes

  • Bipin Joshi


Whenever you navigate between various pages of your web application, the browser maintains a history of the pages you visited. You can navigate through the history using the browser’s back and forward buttons. The same history is accessible to the JavaScript code through the History object. Although the History object isn’t a new addition in HTML5, there are some enhancements to it that are worth knowing about. Especially in Ajax-driven applications, the new History API can prove to be very useful. An Ajax-driven application often changes the web page content without generating unique URLs for each different piece of content rendered in the page. This not only causes mismatches between the bookmarked URLs and the actual content but also makes content difficult for search engines to track. The History API provides a small object model as compared to other HTML5 APIs, but the functionality offered is often desirable when web applications need to synchronize the URL shown in the browser address bar and the page content.


Page Content History Object History Length Dataset Property Ajax Application 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Bipin Joshi 2012

Authors and Affiliations

  • Bipin Joshi

There are no affiliations available

Personalised recommendations