473,378 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Disabling links

I thought that <a href="nowhere.htm" onclick="javascript: return
false">
would disable that link. It does in Firefox but is not doing so in
IE.

Am I doing something wrong? Is there a way to do it that is cross-
browser safe?

Thanks,
Terry

Sep 21 '07 #1
2 1183
Terry wrote on 21 sep 2007 in comp.lang.javascript:
I thought that <a href="nowhere.htm" onclick="javascript: return
false">
would disable that link. It does in Firefox but is not doing so in
IE.

Am I doing something wrong?
Yes.

1 the javascript: is not neccessary,
(unless you have clientside [IE only] vbscript on the same page)

2 it works in IE.

Is there a way to do it that is cross-browser safe?
No,
when Javascript is absent or deactivated in the browser
or has simply errored out,
the link is followed.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 21 '07 #2
On Fri, 21 Sep 2007 06:52:11 -0700, Terry wrote:
I thought that <a href="nowhere.htm" onclick="javascript: return
false">
would disable that link. It does in Firefox but is not doing so in
IE.

Am I doing something wrong? Is there a way to do it that is cross-
browser safe?
This my be a stupid question by why would you bother to provide a link
in the first place if you intend for it to be disabled?

--
I told you this was going to happen.

Sep 21 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Ralph Freshour | last post by:
How can I disable a button once it has been clicked? I want to prevent the user from clicking on it twice if they have a slow connection. Thanks...
4
by: Fluffy Convict | last post by:
I have found a workaround to disable certain options in an option list: var p = document.forms.elements; p.selectedIndex=-1; This works perfectly in IE - the selectedIndex becomes unclickable....
4
by: Old Lady | last post by:
Hi, I need help! I have a SELECT/OPTION list. My goal is to have a TEXT input field in a form that is normally disabled, but it should become enabled when the user select one predefined OPTION....
3
by: PB | last post by:
What is the rationalle for disabling JavaScript. AFAIK, the primary reason is for "security purposes" - but what specific kind of threats does the protect against? AND - is the disabling of...
18
by: seth.m.green | last post by:
<a href="javascript: void(0);" onclick="window.location.href='/foo.bar?one=false&two=true'">Link</a> works like a charm in Firefox. I get NOTHING in IE. but if I replace the javascript: void(0)...
12
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation...
2
by: Nino | last post by:
Hello, I have done some searching through groups and haven't found an answer that suits my needs, so I hope to ask again. Is there a way to disable an anchor tag within HTML? Here's why: I...
1
by: Birmingham | last post by:
i just tried to find my own dropdown links to see if there was a link to my homepage (i'm such a spammer sometimes) and i didn't get one. all i got was a link to click to go to my forum profile page....
2
by: =?Utf-8?B?S3VtYXIuQS5QLlA=?= | last post by:
HI I want to disable the underline of a hyperlink text in a hyperlink column of datagrid/gridview in the content page. If I am writing a css class to disable it in the master page then its...
5
by: jehugaleahsa | last post by:
Hello: I am sure this question comes up a lot. I need to disable the controls on my Windows forms so that when the BindingSource is empty some the controls bound to it will be disabled. This...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.