Browser Compatibility of innerHTML
I have a simple function to refresh a table. It simply creates a table in a div. It works fine in safari and chrome. But for some reason it is not working in firefox. Can anyone suggest me some alternative of this so that it works in firefox as well?
Here's my code -
function tableRefresh(){
POIdiv.innerHT开发者_如何学编程ML=" <table id='POITable' border='1' > <tr><td>POI</td><td>Latitude</td><td>Longitude</td><td>Delete?</td></tr><tr id='tr1'><td id='poinum'>1</td><td><input size=25 type='text' id='latbox' readonly=true/></td><td><input size=25 type='text' id='lngbox' readonly=true/></td><td><input type='button' id=1 value='Delete' onclick='deleteRow_addPOI(this.id)'/></td></tr></table>";
}
This function is called under a button's onclick event.
::::::::::EDIT:::::::::::::
Please try the following link -
http://128.233.104.33/passgui/editLeveledit.php?dbname=reganTest3
Now do these -
- click on map to add some points
- click on "Add the new POIs"
It should upgrade both the tables. Please try it in Google Chore/ Safari first then try it in Firefox. You can find the difference.
Thanks
Define "not work"; it works fine for me on my jsfiddle test in Firefox, with a slight modification since we don't know how you're setting/getting the POIdiv variable.
Change
POIdiv.innerHTML=...
to
document.getElementById('POIdiv').innerHTML=...
精彩评论