Javascript and links in IE6
Moderator: General Moderators
Javascript and links in IE6
Hi!
I thought I could just write a link that calls some javascript and
make it NOT execute the HREF="#" like this:
<a href="#" onclick="toggleOnOff('picture1'); return false">Klick here</a>
This works perfectly (as usual) in Mozilla 1.1, but not in IE 6, where the
page scrolls back up to the top! Why??? Is there a way to avoid this in IE?
/Andreas
I thought I could just write a link that calls some javascript and
make it NOT execute the HREF="#" like this:
<a href="#" onclick="toggleOnOff('picture1'); return false">Klick here</a>
This works perfectly (as usual) in Mozilla 1.1, but not in IE 6, where the
page scrolls back up to the top! Why??? Is there a way to avoid this in IE?
/Andreas
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
trysomeone might show me where <a href="#"> --> do nothing is specified
Code: Select all
<a href="javascript:void(0)" onclick="toggleOnOff('picture1'); return false">Klick here</a>That worked, but not if the user is holding down shift when clicking...
For more info about links and javascript, look here:
http://www.evolt.org/article/rating/17/20938/index.html
It's the 'return false' that should make it stop running the HREF...
(IE is a buggy one...)
For more info about links and javascript, look here:
http://www.evolt.org/article/rating/17/20938/index.html
It's the 'return false' that should make it stop running the HREF...
(IE is a buggy one...)
please excuse me not seeing http://www.evolt.org as authoritative when it comes to html, I thought more of w3.org or similar
Why do you use an uri-anchor (href="..." ) if you do not want to link something?
Why do you use an uri-anchor (href="..." ) if you do not want to link something?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Have you read the evolt article? The guy who wrote it would agree with you since it is mainly focused on accessibility issues.volka wrote:please excuse me not seeing http://www.evolt.org as authoritative when it comes to html, I thought more of w3.org or similar![]()
Why do you use an uri-anchor (href="..." ) if you do not want to link something?
sweahe - you really need to find a better way of doing this than with a link that's not a link.
Mac
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
It's an article on creating accessible links using Javascript, ie. making it so that non JS users don't lose out because of poorly designed links and forms, it's full of suggestions but at no point does it claim to be authoritativevolka wrote:well then....no...it still stands "not authoritative"
Mac

