I am running the < a > tag in php. Whenever I pass an argument in js function it does not get called but if i pass empty arguments, the function gets called.
js:
function displayBigImage(img){
alert("inside func");
}
php:
//NOT WORKING:
echo "<a href='javascript:displayBigImage('".$row['IMG_ID']."')'>Press</a>";
//WORKING:
echo "<a href='javascript:displayBigImage()'>Press</a>";
I also tried with harcode argument values like,
echo "<a href='javascript:displayBigImage('sample.jpg')'>Press</a>";
or
echo "<a href='javascript:displayBigImage(sample.jpg)'>Press</a>";
I don't understand whats wrong?!?!?!?!
PLease reply asap.
Thanks in advance