I looked around but couldn't find an answer to my current issue.
I want to echo a PHP variable into my external .js file. I then use the PHP variable in a javascript variable and from here use ajax to send the variable/s to my database. I believe I am using incorrect syntax for the php echo. My javascript
content = '<div class="post">' + '<img src="<? echo $pic ?>" />' + '</div>';
Is this possible to echo the PHP variable to the external .js file? Am I using the right syntax in the javascript variable?
.jsfile is being served statically, then no, PHP cannot modify it.