Closed Bug 150020 Opened 22 years ago Closed 22 years ago

Problem with div properties

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: fahmy, Assigned: jst)

References

()

Details

Hi,

The below page can be successfully viewed with IE4, IE5, IE6, NS4, NS4.75
http://www.xlstat.com/popup.htm

It cannot with Mozilla 1.0 although the syntax is correct.

Regards,

Thierry Fahmy
Layers isn't supported by Mozilla.
The syntax is incorrect, just read
http://www.mozilla.org/docs/web-developer/faq.html.

This is invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
The bug on http://www.xlstat.com/popup.htm happens on line 
newsDiv = nouv.style;

nouv is the ID of the <DIV>. I think the syntax is correct
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Summary: Problem with layers properties → Problem with div properties
No, it is not.  "nouv.style" means "window.nouv.style".  IE happens to export
every div with an ID into the global (window) namespace.  Mozilla does not, for
various reasons including not cluttering the global namespace.  Other browsers
may or may not do it, depending on the considerations of the developers.  It is
by no means guaranteed to work.

If you use "document.getElementById('nouv').style" that will work in every
browser you list except NS4.x and will also work in Mozilla and any other
DOM-compliant browser (Opera, Konqueror, etc). Since NS4 does not run that
branch anyway, this should be a safe change.
At any rate, this is a DOM issue, not a JS Engine issue.
Reassigning to DOM Level 0 -
Assignee: rogerl → jst
Component: JavaScript Engine → DOM Level 0
QA Contact: pschwartau → desale
And resolving as Invalid per Boris' observation in Comment #4.
Thierry, thank you for this report - 
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.