Feedback on: irt.org FAQ Knowledge Base Q801
Worth:
Very worth reading
Technical:
Just right
Comments:
for Q801, closing tag on your second example should be </A> rather than </HTML>
Comments:
It appears that this JavaScript excerpt is not reliable, as the definition of the A tag and the onClick attribute has it that the HREF attribute will be followed if the onClick JavaScript excerpt returns true.
So if you have
<a href="default.html" onClick="history.go(-1)">, the
history.go(-1) will return true,
causing the default.html to be
jumped to.
IE appears not to do this, either
due to asynchronously executing the default.html jump before the history.go(-1), or through history.go(-1) returning false.. the return value of history.go() appears to be undefined in the JavaScript specs I've seen.
The proper code here should be
<a href="default.html" onClick="history.go(-1); return false">