How do I enter a echo \"hello\"; ?>
in a .js file.
This is a jquery app, therefore the js file.
Thanks Jean
You regularly don't use PHP within your JavaScript files. Javascript is a client-side language which is interpreterred in your web browser. PHP is run on the web server.
However, if you need to pass data from your PHP-code to your javascript document, you can do something like:
$js = "";
print $js;
If you do this in your -part of your HTML-document, you will have access to
myObject
in other JS files you load after that.
$your_data
can be an array or any kind of object, string or integer. Look for PHP JSON around the interwebs.