Okay, I managed to get my page to the following, and it works just fin
in IE, but Mozilla returns a blank page, and the following error in th
Javascript console:
Error: uncaught exception: [Exception... "Not enough argument
[nsIDOMNodeList.item]" nsresult: "0x8057000
(NS_ERROR_XPC_NOT_ENOUGH_ARGS)" location: "JS frame :
file:///C:/Documents%20and%20Settings/Kevin%20Mackey/Desktop/javascript/growtable_test.htm
:: buildTable :: line 25" data: no]
I think I have a vague idea what it's talking about, but I'm not sur
how to go about fixing it.. any help would be appreciated ^^
PHP code
-------------------
<html>
<head>
<script language="javascript">
var maintable = document.createElement("table");
var maintable_body = document.createElement("tbody");
var mt_height;
var mt_width;
function resizeTable() {
if (document.body.clientHeight > (document.body.clientWidth*.714))
{
maintable.setAttribute("width", (document.body.clientWidth)*.975);
maintable.setAttribute("height", (document.body.clientWidth*.714)*.975);
}
else
{
maintable.setAttribute("width", (document.body.clientHeight*1.4)*.975);
maintable.setAttribute("height", (document.body.clientHeight)*.975);
}
}
</script>
<script>
function buildTable(innerTable) {
var mybody = document.getElementsByTagName("body").item();
var myrow = document.createElement("TR");
var mydata = document.createElement("TD");
mybody.appendChild(maintable);
maintable.setAttribute("border","1");
maintable.setAttribute("id","maintable");
maintable.appendChild(maintable_body);
maintable_body.appendChild(myrow);
myrow.appendChild(mydata);
mydata.setAttribute("id","inner_content");
resizeTable();
document.getElementById("inner_content").innerHTML =innerTable;
}
var tableData = "<table height=50% width=50% border=5 bgcolor=lightgrey> <tr> <td align=center> <b>TEST<b> </td> </tr> </table>"
</script>
</head>
<body onload='buildTable(tableData)'>
<script>
window.onresize = resizeTable;
</script>
</body>
</html
-------------------
--
Malkalyps
-----------------------------------------------------------------------
Malkalypse's Profile:
http://www.highdots.com/forums/member.php?userid=2
View this thread:
http://www.highdots.com/forums/showthread.php?t=7169