how do i get this javascript on a mac? i have this code that dynamically creates rows and columns in a table and populates it. it works in IE, firefox, netscape but i cant get it to work on a mac, so i need help:
you can see it tested here:
httttp://68.53.5.167/testtable.cfm
if you try it on IE on a mac, it does nothing.
here is the exact code or you can view source on that page:
<script>
function setUp()
{
ns4=(document.layers)?1:0;
ie4=(document.all)?1:0;
sdom=(document.getElementById && (!(ie4||ns4)))?1:0;
//alert(""+ns4+" "+ie4+" "+sdom);
if(ns4)
{
alert("Upgrade your browser");
}
else if(ie4)
{
sizeTablePath = document.all.sizeTable;
}
else if(sdom)
{
sizeTablePath = document.getElementById('sizeTable');
}
}
function populateSizeTable()
{
size = new Array(3);
size[1-1] = "26";
size[2-1] = "28";
size[3-1] = "30";
clearTable();
table = sizeTablePath;
var length = size.length;
var numCols = 7;
var numRows = Math.ceil(length / numCols);
for( i = 0; i < numRows; i++ )
{
row = table.insertRow(table.rows.length);
var cols = numCols*(i+1);
for( j = numCols*i; j < cols; j++ )
{
sizeNum = (j < length)?(size[j]):0;
cell1inner = (j < length)?"<font face='Arial' size='1'>" + sizeNum +"-</font>":" ";
cell2inner = (j < length)?"<input name='size" + sizeNum + "'type='text' size='2' maxsize='2' value='' >":" ";
cell1 = row.insertCell(row.cells.length);
cell1.setAttribute('align','center');
cell1.setAttribute('width','30');
cell1.innerHTML = cell1inner;
cell2 = row.insertCell(row.cells.length);
cell2.setAttribute('align','center');
cell2.setAttribute('width','47');
cell2.innerHTML = cell2inner;
}
}
}
function clearTable()
{
table = sizeTablePath;
while( table.rows.length > 0 )
{
table.deleteRow(0);
}
}
</script>
</head>
<body onload="setUp();">
<table id="sizeTable" width="200" border="0">
</table>
<input type="button"
onclick="populateSizeTable()"
value="Call function">
</body>
</html>
any ideas?? thanks |