Javascript not working on a mac! Why O why?

Closed Thread

Join Date: Aug 2005
Posts: 4
Reputation: gaston is an unknown quantity at this point 
Solved Threads: 0
gaston gaston is offline Offline
Newbie Poster

Javascript not working on a mac! Why O why?

 
0
  #1
Aug 4th, 2005
Hello,
I have a javascript code (a part of it is in php) that populates a pull-down menu. It works perfectly well with Explorer, Netscape and Firefox under Windows. But impossible to make it work with Explorer or Safari under Mac!!!
Is javascript different between windows and mac?
Here's the code, if anyone has the slightest idea or suggestion.

Thanks a lot in advance!

Gaston.

<SCRIPT type="text/javascript">

function MultiDimensionalArray(iRows,iCols)
{
var i;
var j;
var a = new Array(iRows);
for (i=0; i < iRows; i++)
{
a[i] = new Array(iCols);
for (j=0; j < iCols; j++)
{
a[i][j] = "";
}
}
return(a);
}

function updateDirMenu(form,groupMenu,selectedIndex,selectedGroup, startDirValue){
var numdiringroup = Array()
var dirArray=MultiDimensionalArray(35,0)
var new_index=-1;
var groupPrefs = "<?=$group_prefs?>";
var change = 0;

if (selectedGroup == undefined) {
change = 1
if (groupPrefs != "") {
selectedGroup = groupPrefs}
}


<?php
$x = 0;
$numdiringroup = 0;
//$array = array( 'list', 'of', 'elements' );
while ($x < $num_groups) {


$xx = 0;
foreach ( $filelist[$x] as $element )
{

?>

if (<?=$x?> == selectedIndex) { <?
if ($folder_prefs <> "") {
if ($element == $folder_prefs) {
print "new_index=".$xx.";";}
}
?>
} //if $x==selectedIndex

<?
$xx = $xx + 1;

++$numdiringroup;
print "dirArray[".$x."].push('$element');";
}
++$x;
print "numdiringroup.push('$numdiringroup');";
$numdiringroup = 0;
}

?>


for(i = 0; i < form.elements.length; i++){
if(form.elements[i] == groupMenu){
var dirMenu = form.elements[i+1]
break
}
}

var thelength // thelength is number of options the menu will have
thelength = numdiringroup[selectedIndex]
dirMenu.options.length = thelength

for(i=0; i<thelength; i++){ // if number of current options is less than options to be displayed, write more options
dirMenu.options[i].value=dirArray[selectedIndex][i]
dirMenu.options[i].text=dirArray[selectedIndex][i]
}

if(change == 1) {
if(selectedGroup != groupPrefs || new_index<0) {
if(thelength > 0) {
if(dirMenu.options[0].value == "Home") {
dirMenu.selectedIndex = 1
} //dirmenu
else dirMenu.selectedIndex = 0

} //if thelength
} //if selectedGroup

else dirMenu.selectedIndex = new_index
} //if change

else
for(i=0; i<thelength; i++){

if(dirMenu.options[i].value == startDirValue) {
dirMenu.selectedIndex = i}


} //for
change = 0
}


</SCRIPT>
Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Javascript not working on a mac! Why O why?

 
0
  #2
Aug 4th, 2005
Take this to the web forums, especially JavaSCRIPT or HTML forums.
Java is NOT JavaScript.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Quick reply to this message  
Join Date: Aug 2005
Posts: 4
Reputation: gaston is an unknown quantity at this point 
Solved Threads: 0
gaston gaston is offline Offline
Newbie Poster

Re: Javascript not working on a mac! Why O why?

 
0
  #3
Aug 4th, 2005
Originally Posted by jwenting
Take this to the web forums, especially JavaSCRIPT or HTML forums.
Java is NOT JavaScript.
Oh sorry about that... I'm new to this site and did not look thoroughly at the threads.
I'll post it in the correct thread.

Gaston.
Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Javascript not working on a mac! Why O why?

 
0
  #4
Aug 4th, 2005
It's a common error, the names are somewhat familiar leading people to believe they're one and the same thing sometimes.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Quick reply to this message  
Join Date: Feb 2002
Posts: 12,040
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 127
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Javascript not working on a mac! Why O why?

 
0
  #5
Aug 4th, 2005
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/daniweb
Quick reply to this message  
Closed Thread

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC