I have a function named
test()
defined in a javaScript file called test.js which is reference from the following html:
<html>
<head>
<script src="test.js"></script>
</head>
<?php
echo "<script>test();</script>";
?>
<body>
</body>
</html>
I have verified that test.js works on it's own and the other javascript is being executed by the php. But I'm getting an undefined error.
Error: test() undefined
Can any one tell my how to properly reference a external javascript file from a php script?