...

View Full Version : onclick problem in firefox



bharat1123
12-12-2007, 07:59 AM
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

abduraooft
12-12-2007, 08:29 AM
Look at the semicolon of alert call . The empty argument list is also a problem in FF


<?php
$guyString.="<img src='images/s.jpg' onclick='alert()'; >";
echo $guyString;
?>
,better to write like


<?php
$guyString.='<img src="images/s.jpg" onclick="alert(\'\');" >';
echo $guyString;
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum