469,609 Members | 1,708 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Event bubbling does'nt work

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
3 1169
dmjpro
2,476 2GB
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
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
16,027 Expert Mod 8TB
See JavaScript - Event order.
Oct 1 '07 #4

Post your reply

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

Similar topics

23 posts views Thread by ian justice | last post: by
10 posts views Thread by Nick L | last post: by
1 post views Thread by Arjen | last post: by
2 posts views Thread by Raghu Raman | last post: by
11 posts views Thread by Jim | last post: by
matheussousuke
4 posts views Thread by matheussousuke | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.