By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,292 Members | 1,514 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,292 IT Pros & Developers. It's quick & easy.

Event bubbling does'nt work

P: 9
I am using the IE 6.x & Firefox 2.x

I am trying the event bubbling concept. Herez the code

[HTML]<html>
<head>
<script>
function call_function(evt)
{ .........some_code_here.......}
</script>
</head>
<body>
<div onClick="return call_function(event);">
<a href="http:www.slashdot.org" traget="external">slashdot</a>
<a href="http:www.yahoo.com" traget="external">Yahoo</a>
</div>
</body>
</html>[/HTML]

on the click of the above links the call_function is not getting called.
What is it that I am doing wrong.

Chetan
Oct 1 '07 #1
Share this Question
Share on Google+
3 Replies


dmjpro
100+
P: 2,476
I am using the IE 6.x & Firefox 2.x

I am trying the event bubbling concept. Herez the code
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script> 
  4.  function call_function(evt)
  5.    { .........some_code_here.......}
  6. </script>
  7. </head>
  8. <body>
  9. <div onClick="return call_function(event);">
  10.   <a href="http:www.slashdot.org" traget="external">slashdot</a>
  11.   <a href="http:www.yahoo.com" traget="external">Yahoo</a>
  12. </div>
  13. </body>
  14. </html>
  15.  
on the click of the above links the call_function is not getting called.
What is it that I am doing wrong.

Chetan
Use code tags.
Try this.

Expand|Select|Wrap|Line Numbers
  1. <div>
  2.   <a onclick = "call_function(event)" href="javascript:void(0)" traget="external">slashdot</a>
  3.   <a onclick = "call_function(event)" href="javascript:void(0)" traget="external">Yahoo</a>
  4. </div>
  5.  
Good Luck

Kind regards,
Dmjpro.
Oct 1 '07 #2

P: 9
DMJRPO,

Using the Individual CodeTags negates the purpose of the Event Bubbling
concept.

Chetan

Use code tags.
Try this.

Expand|Select|Wrap|Line Numbers
  1. <div>
  2.   <a onclick = "call_function(event)" href="javascript:void(0)" traget="external">slashdot</a>
  3.   <a onclick = "call_function(event)" href="javascript:void(0)" traget="external">Yahoo</a>
  4. </div>
  5.  
Good Luck

Kind regards,
Dmjpro.
Oct 1 '07 #3

acoder
Expert Mod 15k+
P: 16,027

Post your reply

Sign in to post your reply or Sign up for a free account.