markneustadt.com

So weird…

I was trying to help my users out a little bit recently.  When I picked up an error, I’d trap it, halt execution and notify them.  As a nicety, I presented a “Click here to go back” link.  It worked 99% of the time, but that 1% was killing me!  At least I could reproduce the situation on demand.

The link, as it was read like this…

<a href="javascript:window.history.back();" id="hrefClickToGoBack">&laquo;&laquo;&nbsp;&nbsp;Click here to return to the previous page.</a>

For that 1%, the link was presented, but it just wouldn't work.  WTF?!  After trying every trick in the book, I found that if I added a "NAME" attribute to the link, it began working 100% of the time.
The working link now looks like this.

<a href="javascript:window.history.back();" name="$hrefClickToGoBack" id="hrefClickToGoBack">&laquo;&laquo;&nbsp;&nbsp;Click here to return to the previous page.</a>
Scroll To Top