Running PHP code in Javascript
Posted in Javascript, php, technical stuff, tagged Javascript, php on December 11, 2007 | 1 Comment »
This is what we call external javascript too..
Anyway save your .js file as .php. For example, your js file will be named as file.php
The syntax to referencing a PHP file using external JavaScript is almost same as what we normally do for JS files:
<script type=”text/javascript” src=”file.php”></script>
where “file.php” is either an absolute or relative path to [...]

