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

[whatwg] hashchange only dispatched in history traversal

From: Leons Petrazickis <leons.petrazickis@gmail.com>
Date: Wed, 15 Aug 2007 08:30:05 -0400
Message-ID: <5b04ec2d0708150530t18803272ta421722411c25b8b@mail.gmail.com>
On 8/15/07, Michael A. Puls II <shadow2531 at gmail.com> wrote:
> On 8/14/07, Ian Hickson <ian at hixie.ch> wrote:
> > On Sat, 11 Aug 2007, Michael A. Puls II wrote:
> > > 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
> >
> > I don't know.
> >
> >    <body onfragmentidentifierchange="">
> >
> > ...seems a bit overly long to me, still.
>
> True. As an attribute with the "on" part, it looks pretty bad.


I've always referred to fragment indentifiers as in-page anchors. So, why not:

<body onanchorchange="">

I think it's more readable than onfragmentidentifierchange

There is an HTMLCollection anchors that only lists <a name="">
elements. Extending the link-anchor metaphor into Javascript, the
fragment identifier anchors a DOM state. When a fragment identifier
changes, the anchor of the DOM state changes.

Regards,

Leons Petrazickis
Database Technology Advocate, IBM
http://lpetr.org/blog/
Received on Wednesday, 15 August 2007 05:30:05 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:36 UTC