Side navigation
#1153 closed bug (fixed)
Opened May 01, 2007 04:41PM UTC
Closed September 27, 2007 06:10PM UTC
Last modified March 15, 2012 06:17PM UTC
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: | |
Blocked by: | Blocking: |
Description
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?
Attachments (0)
Change History (4)
Changed May 31, 2007 04:28AM UTC by comment:1
description: | 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? → 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? |
---|---|
resolution: | → fixed |
status: | new → closed |
Changed August 29, 2007 07:42AM UTC by comment:2
resolution: | fixed |
---|---|
status: | closed → reopened |
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.
Changed September 27, 2007 06:10PM UTC by comment:3
milestone: | 1.1.3 → 1.2.2 |
---|---|
resolution: | → fixed |
status: | reopened → closed |
Fixed in Rev [3485]
Changed December 22, 2007 02:49AM UTC by comment:4
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.
Fixed in Rev [1886].