Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onclick problem in firefox

    i have problem in onclick in following code


    <?php
    $guyString.="<img src='images/s.jpg' onclick='alert()'; >";
    echo $guyString;
    ?>
    i am not getting any alert as the ouput while clicking on that image
    please help me out

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Look at the semicolon of alert call . The empty argument list is also a problem in FF
    Quote Originally Posted by bharat1123 View Post
    <?php
    $guyString.="<img src='images/s.jpg' onclick='alert()'; >";
    echo $guyString;
    ?>
    ,better to write like
    PHP Code:
    <?php
    $guyString
    .='<img src="images/s.jpg" onclick="alert(\'\');" >';
    echo 
    $guyString;
    ?>
    Last edited by abduraooft; 12-12-2007 at 09:37 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •