Closed Bug 802874 Opened 12 years ago Closed 12 years ago

Version 16 has a bug with inline event handling, such as onChange, onBlur

Categories

(Firefox :: Untriaged, defect)

16 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mbakerreg, Unassigned)

References

Details

Attachments

(1 file)

Attached image firefoxbug.jpg
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4

Steps to reproduce:

		function getItems() {
			alert("hello");
		}

<select name="jungle" id="jungle" onchange="getItems()">
				<option value="a">A</option>
				<option value="b">B</option>
				<option value="c">C</option>
				<option value="d">D</option>
				<option value="e">E</option>
				<option value="f">F</option>
				<option value="g">G</option>
				</select>


Actual results:

nothing.


Expected results:

there should have been an alert with "hello"

HOWEVER: in some instances it does work.  We have a screen (attached) with multiple onChange events, the first one works, the second one doesn't.  We don't know why - no message in the console, no exceptions reported in the developer tools.
getItems() conflicts with Microdata API which is introduced since Firefox 16.
http://www.w3.org/TR/html5/microdata.html#microdata-dom-api
Blocks: 591467
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Yeah, the problem is that the document is on the scope chain for event handlers....  If you use event handlers, you want to prefix global function calls in them with "window." to avoid problems like this.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: