Problems passing PHP text var as a second var to Javascript Function?

NumNoum

New member
Test #1. This works fine:
$txt0="RRR";
echo ' <a href="?f=3" id="nu'.$var0.'" onclick="func1('.$id0.', '.$id0.');">';

Test #2. This does NOT work, "Done, but with errors on page":
$txt0="RRR";
echo ' <a href="?f=3" id="nu'.$var0.'" onclick="func1('.$id0.', '.$txt0.');">';

THE IMPORTANT THING IS THAT THE JAVASCRIPT FUNCTION
func1(idnum, kkk) works properly for Test#1, but does NOT work for Test#2. This function even does NOT use the second parameter in its body at all because I still test it, but it says "Done, but with errors on page" anyway for Test#2. Why?

Any ideas? Thank you very much.
 
Back
Top