I am making a website that dynamically updates from a mysql database. I have a html index page that calls the javascript functions in a external javascript file. The external javascript runs a php program that pulls data from the mysql database. My problem is that I cannot get the Javascript file to insert the data where I want it in the HTML.
I have a table layed out in the HTML file, so it only has to load the data each time, instead of the entire table. I need to insert the data into the center of the table declaration. I used the
document.getElementById("txtLoc").innerHTML=xmlhttp.responseText;
but that requires that you make a seperate div. As I understand you cannot put a div inside a table? Is there another way to insert the data into the table?
HTML:
<table>
<th></th>
...
<td>! Where I want to insert the data<td>
</table>
The PHP File is formatted so it will apply all of the correct tags, <tr><th>,etc, to the information. The problem is that these are worthless unless they are inside a table declaration.
Thanks,
Joe
I have a table layed out in the HTML file, so it only has to load the data each time, instead of the entire table. I need to insert the data into the center of the table declaration. I used the
document.getElementById("txtLoc").innerHTML=xmlhttp.responseText;
but that requires that you make a seperate div. As I understand you cannot put a div inside a table? Is there another way to insert the data into the table?
HTML:
<table>
<th></th>
...
<td>! Where I want to insert the data<td>
</table>
The PHP File is formatted so it will apply all of the correct tags, <tr><th>,etc, to the information. The problem is that these are worthless unless they are inside a table declaration.
Thanks,
Joe