I would like to call a Javascript function which performs some Ajax operations. And I would like to call it in serverside using PHP echo statement. Is that possible? If not is there any options?
Any help is very much appreciated.
Thank you, Ajeesh
Including javascript code in echo statement
Moderator: General Moderators
Re: Including javascript code in echo statement
The following will include a Javascript file and then you can just call the functions.
I have found it helpful to do this in the past while developing to stop the file from being Cached
Code: Select all
echo "<script type='text/javascript' src='javascript.js'></script>";Code: Select all
echo "<script type='text/javascript' src='javascript.js?".Date("d/m/Y H:i:s")."'></script>";