Closed
Bug 274972
Opened 20 years ago
Closed 20 years ago
object created in javascript gets "xxxx has no properties"
Categories
(Toolkit :: Form Manager, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: mmarino, Assigned: bugs)
References
()
Details
An object created in javascript code gets a "has no properties" error when the focus() method is used. The following line: frm.frmLeagues.focus(); in the following code causes the error: <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>NITTL Standings</title> <script LANGUAGE="JavaScript" FOR="window" EVENT="onLoad()"> <!-- var frm = new Object(); frm = document.formLeagueList; frm.frmLeagues.focus(); //--> </script> </head> <body bgcolor="#C0C0C0">
Comment 1•20 years ago
|
||
Despite Microsoft's claim in http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/htmlfor_0.asp that <script LANGUAGE="JavaScript" FOR="window" EVENT="onLoad()"> is defined in the DOM Level 2 spec as saying the script contents should be assigned to the window.onload, it ain't. The htmlFor property was reserved for future use, and that's it, and in every browser on Earth except IE, that script will run inline, as soon as the <head> is parsed, and fail because the form hasn't been seen yet, or just won't run at all. Put that script in a function, call the function from <body onload="">, and it will work fine in everything.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Updated•16 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•