alphacooler
Programmer
How do I correctly print php code in javascript? I.E.
document.getElementById('photosDiv').innerHTML = '<img src=" echo $row['path'];?>">';
does not work. I can output html just fine, but as soon as I try to output PHP code on a page my javascript stops working. I also tried escaping the ";" with "\" and that didn't do it.
Thanks so very much.
document.getElementById('photosDiv').innerHTML = '<img src=" echo $row['path'];?>">';
does not work. I can output html just fine, but as soon as I try to output PHP code on a page my javascript stops working. I also tried escaping the ";" with "\" and that didn't do it.
Thanks so very much.