Vote count:
0
HI i tring to call a js function in PHP file insi echo "";
and it's not working, if I call it without the echo
it's work, what am I missing here ?
this way it's is work:
<a href='#' onClick='delfrmvbar("dlsyg","<?php echo $sgId;?>","<?php echo $sgId;?>")'>X</a> </span>
and this way is not (I tried without the - ' sign)
echo "<a href='#' onClick='delfrmvbar('dlsyg','$sgId','$sgId')'>X</a> </span>";
asked 1 min ago
1 Answer
Vote count:
0
Your single quotes are the issue because you use single quotes to wrap the onclick attribute, but then use them again around the arguments.
echo "<a href='#' onClick=\"delfrmvbar('dlsyg','$sgId','$sgId')\">X</a> </span>";
answered just now
Aucun commentaire:
Enregistrer un commentaire