Using a # in a dummy onclick plus page reload

L

Logos

Hi friends and neighbours! Gotta problem, maybe you can help...

I'm using a dummy # reference in an href so I can use the onclick
event. This works well.

The problem comes when a user hits the browser's reload button...the
Address Bar now reads http://mydomain//mypage.html#, and this produces
weird javascript errors on line 1. I tried adding a phony href (<a
href="#" onclick="window.location.reload(true)"></a>) to refresh, but
obviously the click event isn't being fired when the browser's reload
button is hit. Can anyone suggest an alternative?

Tyler
tyler...AT...(healthyhabitsweb) dot [com]
 
V

VK

Logos said:
Thanks!!! You are my hero! Plus the site has oodles of other good
schtuff - extra scooby snack for you!

You may want to forward your thanks to Matt Kruse who prepared and keep
updating this source: see also "Updated Javascript Best Practices
document" thread in this newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,177
Latest member
OrderGlucea
Top