W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2007

[whatwg] Feature request: Provide event to detect url hash (named anchor) change

From: Agustín Fernández <yo@agustinfernandez.com.ar>
Date: Sat, 23 Jun 2007 18:22:53 -0300
Message-ID: <1182633774.6396.17.camel@localhost>
Hi,

There is currently no way to detect a change in the url of a page other
than polling for changes in document.location.hash all the time (which
is slow and potentially complex, and doesn't always work in IE -) or
listening for click events on all links (which doesn't catch changes not
started by clicking on links -such as clicking back and forward, or
changing the hash by hand-).

Changing the hash in a page is useful to provide bookmarks and back and
forward functionality in ajax driven web applications which never fetch
a new page and is used extensively in the web.

I propose an urlchange (urlhashchange? hashchange? locationchange?)
event which would be dispatched by the BODY element whenever the hash
portion of the url changes.

You can see an example app which uses this in
http://mini.adondevamos.com/ (in spanish).

I filed this in bugzilla:

https://bugzilla.mozilla.org/show_bug.cgi?id=385434

. A .
Received on Saturday, 23 June 2007 14:22:53 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:56 UTC