I'm having a little problem with a site of mine.. On one page I have a list of items, which are defined in a .js file, in arrays. Separate arrays are used to store different information about my items.. Like:
--8<--
id = new Array;
info = new Array;
id[id.length]="firstItem";
info[info.length]="Info on the first item";
id[id.length]="secondItem";
info[info.length]="Info on the second item";
--8<--
So it's a really simple database of sorts. My problem is that I have items where some of the properties are undefined, and I used the undefined constant in JS for that. If I didn't assign a value to the array that doesn't have a "real" value, using array.length for new items wouldn't work right.
The page works just fine in IE 5.0 and up, Netscape 6, and Opera 5, but I have gotten a few error reports(that aren't really informative) from people using IE 4. They're getting runtime errors.. I don't have access to a machine with IE 4 so I could reproduce this problem.
So, is the undefined -constant not compatible with older browsers? I can't figure out what else could be causing this problem, since the rest of the JS I'm using is pretty basic. Am I going to have to rewrite my scripts to use something else than undefined?
Well there are a couple of things (sorry new to the group and I can't get the quote to go on .
When you define your Arrays you are leaving out the ()
var id=new Array();
var info=new Array();
type of thing.
That should do it as I didn't see anything else wrong. The constants should default to the correct number of the array. The only thing I can think of is if they are using prowser pre ver 3.0 if thats true than I will go into more detail.
Bookmarks