G
GRenard
Hi,
I'm trying just to display a table on a webpage using DOM elements
created dynamically.
I really don't understand why IE doesn't display the document
successfully...
If I make a copy/paste of the output, I can see the data.
Mozilla displays successfully a table... Check this little code :
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Test</title>
</head>
<body onload="">
<table>
</table>
<p></p>
</body>
<script type="text/javascript">
var pItem = document.getElementsByTagName("p").item(0);
pItem.appendChild( document.createTextNode("TEST") );
function onLoaded(infoOn) {
var table = document.getElementsByTagName("table").item(0);
for(val in infoOn) {
currentRow = document.createElement("tr");
currentCell = document.createElement("td");
currentText = document.createTextNode(val);
currentCell.appendChild( currentText );
currentRow.appendChild(currentCell);
table.appendChild(currentRow);
}
table.style.visibility = "visible";
table.setAttribute("border", "1");
}
onLoaded(document.getElementsByTagName("table"));
</script>
</html>
On IE, this code "displays" only "TEST" but try Copy/paste and the data
will be pasted... so what is the problem ?
Thank you very much.
I'm trying just to display a table on a webpage using DOM elements
created dynamically.
I really don't understand why IE doesn't display the document
successfully...
If I make a copy/paste of the output, I can see the data.
Mozilla displays successfully a table... Check this little code :
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Test</title>
</head>
<body onload="">
<table>
</table>
<p></p>
</body>
<script type="text/javascript">
var pItem = document.getElementsByTagName("p").item(0);
pItem.appendChild( document.createTextNode("TEST") );
function onLoaded(infoOn) {
var table = document.getElementsByTagName("table").item(0);
for(val in infoOn) {
currentRow = document.createElement("tr");
currentCell = document.createElement("td");
currentText = document.createTextNode(val);
currentCell.appendChild( currentText );
currentRow.appendChild(currentCell);
table.appendChild(currentRow);
}
table.style.visibility = "visible";
table.setAttribute("border", "1");
}
onLoaded(document.getElementsByTagName("table"));
</script>
</html>
On IE, this code "displays" only "TEST" but try Copy/paste and the data
will be pasted... so what is the problem ?
Thank you very much.