Event bubbling does'nt work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • connectwithme
    New Member
    • Sep 2007
    • 9

    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(e vt)
    { .........some_c ode_here....... }
    </script>
    </head>
    <body>
    <div onClick="return call_function(e vent);">
    <a href="http:www. slashdot.org" traget="externa l">slashdot</a>
    <a href="http:www. yahoo.com" traget="externa l">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
    Last edited by gits; Oct 1 '07, 07:33 AM. Reason: added code tags
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by connectwithme
    I am using the IE 6.x & Firefox 2.x

    I am trying the event bubbling concept. Herez the code
    [code=html]
    <html>
    <head>
    <script>
    function call_function(e vt)
    { .........some_c ode_here....... }
    </script>
    </head>
    <body>
    <div onClick="return call_function(e vent);">
    <a href="http:www. slashdot.org" traget="externa l">slashdot</a>
    <a href="http:www. yahoo.com" traget="externa l">Yahoo</a>
    </div>
    </body>
    </html>
    [/code]

    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.

    [code=html]
    <div>
    <a onclick = "call_function( event)" href="javascrip t:void(0)" traget="externa l">slashdot</a>
    <a onclick = "call_function( event)" href="javascrip t:void(0)" traget="externa l">Yahoo</a>
    </div>
    [/code]

    Good Luck

    Kind regards,
    Dmjpro.

    Comment

    • connectwithme
      New Member
      • Sep 2007
      • 9

      #3
      DMJRPO,

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

      Chetan

      Originally posted by dmjpro
      Use code tags.
      Try this.

      [code=html]
      <div>
      <a onclick = "call_function( event)" href="javascrip t:void(0)" traget="externa l">slashdot</a>
      <a onclick = "call_function( event)" href="javascrip t:void(0)" traget="externa l">Yahoo</a>
      </div>
      [/code]

      Good Luck

      Kind regards,
      Dmjpro.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        See JavaScript - Event order.

        Comment

        Working...