Errors Occur in Internet Explorer, but not Mozilla

In the onLoad event of a form, the two errors indicated in the code below occur in Internet Explorer 6.0, but not in Mozilla Firefox 1.0.5.

var args = new Array, cArg = 0, docCtr, id

for (docCtr = 0; docCtr < cSel; docCtr++) {

id = selectedDocs.elementAt(docCtr)

if (id.length( ) == 32) { // error - function expected

 args[cArg++] = id        // unterminated string constant

}

}

I’d appreciate any ideas on why the errors only occur in Internet Explorer 6.0. Thanks.

Subject: Errors Occur in Internet Explorer, but not Mozilla

length is a property, not a method – there should be no parentheses. Don’t rely on IE to tell you what the error actually is – once somthing goes wrong, it gets horribly confused.