A
aric.bills
Hello all,
I'm a novice Javascript programmer, and I'm having browser
compatability issues regarding dynamic generation of tables. The
following content generates "hello" in Firefox 1.5, but just a blank
page in IE 6. Can anybody tell me what I should change to make IE
happy? Even better, is there any kind of tutorial out there on
dynamically generating tables?
Many thanks,
Aric
<html>
<head>
<title> Test </title>
<script language="javascript">
<!--
window.onload = init;
function init() {
var el = document.createElement('table');
var row = document.createElement('tr');
var col = document.createElement('td');
col.appendChild(document.createTextNode('hello'));
row.appendChild(col);
el.appendChild(row);
document.getElementById('mydiv').appendChild(el);
}
// -->
</script>
</head>
<body>
<div ID="mydiv">
</div>
</body>
</html>
I'm a novice Javascript programmer, and I'm having browser
compatability issues regarding dynamic generation of tables. The
following content generates "hello" in Firefox 1.5, but just a blank
page in IE 6. Can anybody tell me what I should change to make IE
happy? Even better, is there any kind of tutorial out there on
dynamically generating tables?
Many thanks,
Aric
<html>
<head>
<title> Test </title>
<script language="javascript">
<!--
window.onload = init;
function init() {
var el = document.createElement('table');
var row = document.createElement('tr');
var col = document.createElement('td');
col.appendChild(document.createTextNode('hello'));
row.appendChild(col);
el.appendChild(row);
document.getElementById('mydiv').appendChild(el);
}
// -->
</script>
</head>
<body>
<div ID="mydiv">
</div>
</body>
</html>