[whatwg] hashchange only dispatched in history traversal

Michael A. Puls II shadow2531 at gmail.com
Sat Aug 11 19:36:11 PDT 2007


On 8/10/07, Maciej Stachowiak <mjs at apple.com> wrote:
> I would also suggest calling it something other than hashchange. I
> realize the term "hash" is used in other places in the HTML DOM to
> refer to the fragment ID but it sounds weird in an event name like
> that. CSS uses "target" and the URI RFC uses "fragment identifier".

I like "hashchange" even if it's not perfectly descriptive.

However, "fragmentidentifierchange" although long, isn't much longer
than DOMAttributeModified
and is shorter than say, DOMNodeRemovedFromDocument.

addEventListener("fragmentidentifierchange" doesn't seem too bad to me.

And, if for some reason you wanted it shortened in your script, you
could just do:

var hashchange = "fragmentidentifierchange";
a.addEventListener(hashchange
b.addEventListener(hashchange
c.addEventListener(hashchange

-- 
Michael



More information about the whatwg mailing list