1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

function not called!

Discussion in 'JavaScript' started by US_MAN, Dec 25, 2007.

  1. #1
    im trying to call a function onClick event but its not working for me..
    the red color script is the one i want to call onClick
    the green one is basically dropdown menu script (frm dynamic drive)

    see the bold area of green 1, if i replace this with
    the script no longer work well (not show dropdown menu)
    can any 1 help me regarding how can i call the function in
    <a href="#" class="subnav2" >Search 3</a>



    the whole page code is:
     
    US_MAN, Dec 25, 2007 IP
  2. hogan_h

    hogan_h Peon

    Messages:
    199
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your links array should be built like this:
    
    srch[0]='<a href="#" class="subnav2" onClick="msg(\'Search1\');">Search 1</a>'
    srch[1]='<a href="#" class="subnav2" onClick="msg(\'Search2\');">Search 2</a>'
    srch[2]='<a href="#" class="subnav2" onClick="msg(\'Search3\');">Search 3</a>'
    
    Code (markup):
    Single quotes inside single quote statement must be escaped with backslash.
     
    hogan_h, Dec 25, 2007 IP
  3. US_MAN

    US_MAN Peon

    Messages:
    26
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    worked :)


    thnx again hogan
     
    US_MAN, Dec 25, 2007 IP