Closed Bug 3165 Opened 26 years ago Closed 25 years ago

location object not found

Categories

(Core :: JavaScript Engine, defect, P2)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: jgmyers, Assigned: vidur)

References

()

Details

Running 'viewer', the following javascript generates the error:

JavaScript error: location is not defined

if (location.search)
    user = location.search.substring(6, location.search.length)
Assignee: mccabe → vidur
Looks like a DOM omission.

I see 'Document Object Model' in the mozilla modules page, but not in the
components list.  Does the bugsplat modules list need a revision?
per leger, assigning QA contacts to all open bugs without QA contacts according
to list at http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser
DOM bugs are not my problem.
QA Contact: 4015 → 4616
QA contact re-assigned according to the product areas we're currently working
on.
Status: NEW → ASSIGNED
The problem exists because of the unqualified reference to "location". It should
work with "window.location". Either way, it's still a valid compatibility bug.
Both IE and Communicator work with an unqualified "location".  Is there a
standard for the DOM which specifies (or not) the implicit "with (window)"?
The bug is just a result of the way we implemented window.location. In other
cases, the implict scope for unqualified references is the window.
*** Bug 3582 has been marked as a duplicate of this bug. ***
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fixed on 3/26/99. There was a bug in the resolve method for the Window JSClass.
Status: RESOLVED → VERIFIED
Bug is verified.
If we try this code, it shows that location object could be found.

code:

<html>
<head>
<title>dfhg</title>
</head>

<body >
<script>
<!--
if (location.search){
         document.location.replace("http://www.yahoo.com")}
else{
document.location.replace("http://www.hotmail.com")}
//-->
</script>
</body>
</html>

So marking this bug as verified.
Changing component to "Javascript Engine".  "Javascript" component is being
retired.
You need to log in before you can comment on or make changes to this bug.