There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Apple Macintosh
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > Apple Macintosh >
how do i get this javascript on a mac?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
soadfan's Avatar
Junior Member with 2 posts.
 
Join Date: Feb 2005
Experience: Intermediate
21-Feb-2005, 12:08 AM #1
Question 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>":"&nbsp;";
cell2inner = (j < length)?"<input name='size" + sizeNum + "'type='text' size='2' maxsize='2' value='' >":"&nbsp;";
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
iswan1's Avatar
Junior Member with 2 posts.
 
Join Date: Jul 2007
Experience: Beginner
13-Jul-2007, 03:23 AM #2
I have some dowt on the below code


$nextLevel='var tbodyElem = document.getElementById("'.$tmpNodeId.'").rowIndex;
alert(tbodyElem);trElem = tableBody.insertRow(tbodyElem+);
trElem.name='.$mainLevelNo.';
trElem.value='.$subLevelNo.';
trElem.id="'.$tmplformid.'";
tdElem=trElem.insertCell();
tdElem.value=0;
tdElem.style.textIndent='.$indents.';
tdElem.id="col_'.$tmplformid.'";
tdElem.className="'.$classStyle.'";';

this code is working in window's IE. but it is not working in MAC's FireFox.

Iswan1
iswan1's Avatar
Junior Member with 2 posts.
 
Join Date: Jul 2007
Experience: Beginner
13-Jul-2007, 04:05 AM #3
trElem = document.getElementById("tableBody").insertRow(tbodyElem+1);

This is working in both MAC and Windows. But,

tdElem=trElem.insertCell();

is not working. can you help me to solve this?
xrey's Avatar
Computer Specs
Junior Member with 1 posts.
 
Join Date: Jul 2007
Experience: Intermediate
14-Jul-2007, 12:25 PM #4
No users on IE Mac
According to statistics, only 4% of overall users are Macs and Safari is the native browser ( my preference is Firefox). If your code doesn't work only on IE Mac, I'm not sure you should expend this much effort because that audience is in decimal point. Otherwise, I think you're good.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:22 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.