I understand that one can\'t execute PHP from the client side (JavaScript), but what would then be the appropriate approach? Writing my jQuery in PHP? Here is an example of what
First, you should wrap js-code with script-tag:
script
If you want to pass some data from PHP to JS use echo:
echo
where $image-php variable. In general you may generate any JS code using PHP as well as html.
$image
To pass data from JS to PHP (from client to server) use AJAX
I hope this will help.