Solved

e.preventDefault

Posted on 2010-09-20
6
865 Views
Last Modified: 2012-05-10
On click of an anchor tag i'm calling a javascript function.
In the function I'm using e.preventDefault and e.stopPropagation. After this the anchor tag becomes unclickable.

Any ideas?
0
Comment
Question by:informaniac
6 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33714902
<<In the function I'm using e.preventDefault and e.stopPropagation. After this the anchor tag becomes unclickable.>>
that is the whole idea,
when you do e.preventDefault it prevents the default behavior, which is making the anchor tag clickable
when you do e.stopPropagation, it prevents the event handling from propagating further.
http://www.openjs.com/articles/prevent_default_action/
0
 
LVL 20

Author Comment

by:informaniac
ID: 33714935
How does it work in FF and IE 7 then?
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 33714977
Don't think IE has e.preventDefault method.
Not sure why it is not working in FF

The link i have shared has an explanation
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:amischol
ID: 33715614
Hi, could you append your code?

It will help us to see what's the real problem.

Thanks.
0
 
LVL 3

Expert Comment

by:VeganBen
ID: 33717371
it's not that it's becoming uncilckable, it is that the click action of the link has been modified to perform some javascript functionality instead of redirecting the browser.

As amischol says...code please!
0
 
LVL 20

Accepted Solution

by:
informaniac earned 0 total points
ID: 33745511
Ok. I'm not sure why this is happening. But this thing works on production environment.
Sorry I can't paste the code here.
What I'm trying to do is. I developed an ajax control that inherits from the AjaxModalPopup Extender control.

In IE6. it happens that any dropdowns beneath the modal get hidden. So I had to use e.preventDefault and e.stopPropagation
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
using php variable inside javascript 5 16
replace all occurrences within a string 8 19
CONVERT JAVASCRIPT BUTTON TO HYPERLINK TEXT 6 21
Python - desktop use 1 10
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now