Ajax – Bookmarks & Browser History


Below are the two main drawbacks of the Ajax.

  • browser history is not added  – browser back button is not working when you rendered a web page using ajax. the reason, browser history is not updated while rendering a page using ajax
  • difficult to bookmark a page. – pages are rendered using javascript(ajax) , so not able to bookmark the page link.

How to solve this problem.?

We have to write a code to solve this problem. The main logic is LIFO(Last In First Out). Lets see how to implement that logic, write a javascript code to store the rendered page content into our own history stack and then shows the last stored page when browser back button is fired/triggered.

Also have another option., open source library to achieve the same. Simplest one is Really Simple History library. RSH is a lightweight javascript library for managing browser back & bookmarking in Ajax applications.

How RSH works.?

For IE browsers, hidden iframe used to trigger history changes
For other browsers, regular interval checks of location changes.

RSH will support IE, Firefox & Opera browsers.

For more details about RSH, please visit this link http://code.google.com/p/reallysimplehistory

Want to learn Ajax Basics, visit this link https://manikandanmv.wordpress.com/2008/09/23/ajax-asynchronous-javascript-and-xml/

Advertisements

Tags: , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: