Solved

e.preventDefault

Posted on 2010-09-20
6
864 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
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…

758 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

17 Experts available now in Live!

Get 1:1 Help Now