Onlick() Help

Discussion in 'Programming' started by fakhruddin, Sep 15, 2006.

  1. #1
    Helllo i am having a problem in 1 script

    <a href="#0" class="mtext" onclick="shide<?php echo $mxx; ?>(); return false;">Show/hide links and options for this image</a>

    i want to change this

    wat i wanna do is make it such a way

    that onclick="shide<?php echo $mxx; ?>(); is already started when page is loaded

    plz help
     
    fakhruddin, Sep 15, 2006 IP
  2. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I believe you're after the onload parameter for the body tag.

    Something along the lines of:
    <body onload="shide<?php echo $mxx; ?>(); return false;">

    instead of just the normal <body>.
     
    TwistMyArm, Sep 15, 2006 IP
  3. fakhruddin

    fakhruddin Peon

    Messages:
    193
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    doesnt work

    1 question shoud the javascript be after this or before it
     
    fakhruddin, Sep 15, 2006 IP
  4. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Maybe before, I couldn't really tell you.

    Stupid question, but the code you gave right at the start: it was working where it was, right?
     
    TwistMyArm, Sep 16, 2006 IP
  5. fakhruddin

    fakhruddin Peon

    Messages:
    193
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ya when we click the link it works
     
    fakhruddin, Sep 16, 2006 IP
  6. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Then there's no reason why that shouldn't work.

    Open up the Javascript Console in Firefox and reload the page... that will give you any errors that occur.
     
    TwistMyArm, Sep 16, 2006 IP