registereduser4
10-22-2009, 04:56 PM
I have HTML file and a separate javascript file js.js. I link js.js from HTML file by put following scripts in HEAD of HTML:
<script type="text/javascript" src="js.js"></script>
It works fine. Now I would like to add a PHP file for purpose to get data from MYSQL database. I wish to use php to retrieve a table, then turn it into an array which is to be used by the js.js file.
My question is how do I link js.js and php.php? Since retrieving action is initiated by js.js and the array is to be used by js.js, I guess I need to put something as follows in js.js rather than in HTML file.
<script type="text/javascript" src="php.php"></script>
How do I do it? Thanks.
<script type="text/javascript" src="js.js"></script>
It works fine. Now I would like to add a PHP file for purpose to get data from MYSQL database. I wish to use php to retrieve a table, then turn it into an array which is to be used by the js.js file.
My question is how do I link js.js and php.php? Since retrieving action is initiated by js.js and the array is to be used by js.js, I guess I need to put something as follows in js.js rather than in HTML file.
<script type="text/javascript" src="php.php"></script>
How do I do it? Thanks.