[Seaside] [2.8] WAAnchorTag>>onClick:

Lukas Renggli renggli at gmail.com
Sat Jul 7 09:27:05 UTC 2007


> This one took almost 20 minutes to track down. Previous version stuffed
> 'javascript:void(0)' into href-less anchors to make browsers respect it
> as an anchor and apply styles, whereas 2.8 is not doing it anymore. What
> was the reason for removal?

Note that Seaside 2.8 is still work in progress and that you just
discovered a place where refactorings are going on.

The initial reason for this change was WAPopupAnchorTag:

1. WAPopupAnchorTag produced invalid Javascript up to know.

2. The recent refactoring enables:
   - Search engines follow the link.
   - Anchors work even if Javascript is disabled.
   - Power user have a better control where the new window should be
opened (same window, new window, new tab).

3. Moreover the refactoring made WAPopupAnchorTag a real subtype of
WAAnchorTag, before it was just a hack that added some behavior of
WAAnchorTag but mostly destroyed functionality from its superclass.

4. Less code. Less magic.

This refactoring would not have been possible, if WAAnchorTag
automatically added javascript:void(0) to the on click event.

We are about to clean up WAAnchorTag (in a backward compatible way).
Some general ideas that drive these cleanups of the tag hierarchy are:

1. Dependencies in the order of configuration messages should be
avoided altogether (this was not the case with #onClick:). The only
thing people should need to know is that #with: has to be last.

2. Configuration messages should not have unpredictable side-effects
(again this was not the case with #onClick:).

3. URLs should be URL objects, not Strings. Only this allows to
properly encode the resulting response.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the Seaside mailing list