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

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top