Open
Bug 264343
Opened 20 years ago
Updated 2 years ago
variable context loss when overloading onsubmit
Categories
(Core :: DOM: Core & HTML, defect, P5)
Tracking
()
NEW
People
(Reporter: trash, Unassigned)
References
()
Details
Attachments
(1 file)
|
1.29 KB,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; rv:1.7.3) Gecko/20041001 Firefox/0.10.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; rv:1.7.3) Gecko/20041001 Firefox/0.10.1
When overloading a form's onsubmit event, the scope of the "this" object is
lost, and "this" becomes a reference to the window object within the original code.
I'm not certain that this qualifies as a bug, but it does represent different
behavior from /that/other/evIl/browsEr/. IE's treatment seems more intuitive.
Reproducible: Always
Steps to Reproduce:
Create a form with an onsubmit event that references the "this" object.
Use javascript to modify that event by capturing a reference to it, and calling
that reference. EG:
var theForm = document.getElementById("myForm");
var oldSubmitCodeRef = theForm.onsubmit;
theForm.onsubmit = function(e){
return oldSubmitCodeRef(e);
}
Execute the form's submit event and observe that the scope of "this" within the
original code no longer references the form object.
Actual Results:
"this" becomes a reference to the window.
Expected Results:
"this" should have continued to be a reference to the form.| Reporter | ||
Comment 1•20 years ago
|
||
Comment 2•19 years ago
|
||
Rhino has nothing to do with mozilla/firefox.
Component: Core → DOM
Product: Rhino → Core
Version: other → Trunk
Updated•19 years ago
|
Assignee: igor → general
QA Contact: pschwartau → ian
Updated•15 years ago
|
Assignee: general → nobody
QA Contact: ian → general
Comment 3•6 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
| Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•