[thelist] Frames, Javascript and IE 5.5 continued....

.jeff jeff at members.evolt.org
Mon Jul 23 13:34:26 CDT 2001


ppk,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Peter-Paul Koch
:
: Interesting... I've added return false, but I can't
: test it since I don't have IE5.0 at home.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<http://www.xs4all.nl/~ppk/hreftest/frametesting.html>

now the 3rd and 4th links work as expected, loading page2.html into the top
frame "up".

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: However, this seems to be a specific IE behaviour that
: I've noted before.  The onClick is executed before the
: actual href, and what I'd think is that the execution
: of location.href would remove the page from the window,
: cancelling the href. However, it doesn't.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

it's more than just ie, mind you.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: I noted the same behaviour in another context (forms
: and submit()? something like that) and it seems that
: Netscape does indeed cancel the href because the page
: is gone, but Explorer doesn't.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

yes, netscape will behave in this same fashion when submitting a form and
attempting to change the location all in one fell swoop.  it will simply
ignore the location change and continue on with the submission.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Still the question remains why IE5.5 does not do the
: same as 5.0. It lets the location.href cancel the
: A HREF.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

possibly a re-ordering of the events and which one takes precedence?

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: More research is clearly necessary.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

yes, agreed.  one thing's for certain though -- never assume how the browser
will behave.  if you don't want it to execute the href, include a return
false in the onclick event handler.

thanks,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list