Ticket #1153 (closed bug: fixed)
IE sometimes objects to jquery.event.fix
| Reported by: | wizzud | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 1.2.2 |
| Component: | event | Version: | 1.1.2 |
| Keywords: | pageX pageY IE fix | Cc: | |
| Blocking: | Blocked by: |
Description (last modified by brandon) (diff)
I have a problem with IE and the fix method of jquery.event, whereby it (IE) sometimes objects to the variable b (=document.body) not being an object. This usually happens on a page refresh, but cannot reliably be re-produced. The solution I have put in place is a very small modification to the assignment of the 'e' and 'b' variables prior to setting event.pageX and event.pageY (if they are not available).
Using jquery 1.1.2 rev 1465 code, at line 2904 I changed
var e = document.documentElement, b = document.body;
to
var e = document.documentElement || {}, b = document.body || {};
and this solved the problem.
I have not been able to find any reports of anybody else having this same problem, so why it should be happening to me I'm not sure. I am developing with the Ext library, using jquery as the engine, and I don't know if that is having any effect, but if it is I can't see why it should! Anyway, its a really minor change, but if it could be incorporated into the jquery core it would save me having to re-apply it on updates?
Change History
comment:1 Changed 6 years ago by brandon
- Status changed from new to closed
- Resolution set to fixed
- Description modified (diff)
comment:2 Changed 6 years ago by djdula
- Status changed from closed to reopened
- Resolution fixed deleted
I am using Jquery 1.1.4 (also using Ext, but not sure if thats whats causing it), and this bug STILL comes up in IE6 during refreshes/initial loads.
I am getting the error message "Object required" for that same line
So what I did was what the initial recommended fix was and removed
var e = document.documentElement, b = document.body;
And put in
var e = document.documentElement || {}, b = document.body || {};
and now everything works fine. I know since that this was first reported there have been slight changes to the surrounding code in the same function but those did NOT fix/suppress? the error it like the above code does.
comment:3 Changed 6 years ago by brandon
- Status changed from reopened to closed
- Resolution set to fixed
- Milestone changed from 1.1.3 to 1.2.2
Fixed in Rev [3485]
comment:4 Changed 5 years ago by stomph
I had the same issue with jQuery 1.2.1.
I'm also using it together with Ext and would sometimes get an 'Object required' error in IE6 on reloading a page and simultaneously moving the mouse around on the page. (->click reload->move mouse around on page->error).
Applying the fix seems to have solved the issue.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Fixed in Rev [1886].