Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

e.preventDefault

Posted on 2010-09-20
6
Medium Priority
?
910 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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

618 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