Need to work around bad Javascript: () instead of []

RESOLVED WONTFIX

Status

()

--
enhancement
RESOLVED WONTFIX
15 years ago
14 years ago

People

(Reporter: david.hagood, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

In trying to access the road data for the Wichita metro area, nothing happens.
The JS console shows an error on the document:

Error: top.fraNav.document.all is not a function
Source File: http://www.kanroad.org/kanroadpublic/Ksys/DisplayMap.asp?Mode=9
Line: 11

Which boils down to the following broken code:
if (top.fraNav.document.all("chkAlert"))	{
						top.fraNav.document.all("chkAlert").checked = true;
						top.fraNav.document.all("chkCondition").checked = true;
}

In other words, the person creating this site confused () with [].

IE seems to work - so it would seem that IE is forgiving the stupidity.

IF this is the case, then perhaps Moz should try to work around this stupidity
(preferably with a BIG NASTY WARNING in the JS console)?


Reproducible: Always

Steps to Reproduce:
1. Go to http://www.kanroad.org/ (it will redirect to the URL given)
2. Click on the "Wichita Metro Area" link in the left frame


Actual Results:  
No visible response, and an error is logged to the JS console.

Expected Results:  
Shown the link - in other words, gotten the JS error, said "Hmm. OK, this isn't
a function - maybe it is an array? Yep, that works - OK, the webmaster is
stupid, what a surprise, work around it and log it."
It wouldn't work with [] either -- the problem is that document.all is a 
non-standard IE-specific property.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → INVALID

Comment 2

14 years ago
Now that undetected document.all is supported (see bug 248549), it would help to
implement this syntax that IE supports. Many sites listed in evangelism bugs use
this syntax. See bug 249407, bug 234267, bug 232535, bug 231797, bug 220538, bug
219471, etc.
Severity: normal → enhancement
Status: RESOLVED → UNCONFIRMED
OS: Linux → All
Hardware: PC → All
Resolution: INVALID → ---
Summary: Need to work around bad Javascript: () instead of [] → Need to work around bad Javascript: () instead of [] accessing document.all
We don't need to fix this bug, the document.all conditional emulation that went
in recently handles VB-style item access.

This bug should be WONTFIX for now, pending evangelism data showing it's needed
for other collections than document.all.

/be
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago14 years ago
Resolution: --- → WONTFIX
Summary: Need to work around bad Javascript: () instead of [] accessing document.all → Need to work around bad Javascript: () instead of []
You need to log in before you can comment on or make changes to this bug.