Markc:AJAX URLs

From MozillaWiki
Jump to: navigation, search

Introduction

An increasing number of sites use AJAX to populate pages and navigate to other content. It is well documented that this can "break" the ability to bookmark sites. There are workarounds for this issue, but it would be simpler and clearer for the user if the URL changes in response to their actions, even though they remain on the same page.

Proposal

I am suggesting a mechanism whereby a developer can change the current URL without navigating away from the current page. They could update or alter the URL from script in order to produce a URL that can be bookmarked to bring the user back to page in its current state.

Security Concerns

Allowing sites to set any URL could be used for malicious purposes. The functionality would have to have a "same domain" limitation to help prevent this. Highlighting the address bar temporarily when the URL changes would also help to alert the user to the change.

Use Case

Karl develops web pages and wishes to populate the screen via AJAX to avoid the page refreshing as users navigate around his site. However he would like the users to be able to bookmark their current view of the site. By changing the URL to include relevant parameters in the query string his users can bookmark the site and he can easily retrieve the parameters in order to re-populate the page as required.