?
Solved

e.preventDefault

Posted on 2010-09-20
6
Medium Priority
?
900 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
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:Gurvinder Pal Singh
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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

762 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