Bug Tracker

Opened 13 years ago

Closed 13 years ago

#1327 closed bug (duplicate)

Java Script Object Required in line 1324

Reported by: maethorin Owned by:
Priority: major Milestone: 1.1.4
Component: event Version: 1.1.3
Keywords: Object Required Cc:
Blocked by: Blocking:

Description

Hi all,

I have this BUG when use jQuery in IE and find just one coment about it in the internet:

http://lists.wymeditor.org/pipermail/wymeditor-devel/2007-March/000016.html

Its give me a very important information (where the bug is), but don't resolve the problem.

Look at the code I found the following lines:

1321: if ( event.pageX == undefined && event.clientX != undefined ) {
1322:  var e = document.documentElement, b = document.body;
1323:  event.pageX = event.clientX + (e.scrollLeft || b.scrollLeft);
1324:  event.pageY = event.clientY + (e.scrollTop || b.scrollTop);
1325: }

I don't understand why the BUG fired at 1324 and not in the 1323... I think is a message erro problem of the IE.

I change the code to this:

if ( event.pageX == undefined && event.clientX != undefined ) {
   var e = document.documentElement, b = document.body;
   if (e) {
      event.pageX = event.clientX + (e.scrollLeft);
      event.pageY = event.clientY + (e.scrollTop);
   }
   else if (b) {
      event.pageX = event.clientX + (b.scrollLeft);
      event.pageY = event.clientY + (b.scrollTop);
   }
}

With this, the BUG was fixed. I send this to you to verified the impact of this change in the core of the jQuery.

Regards

Márcio Duarte

Change History (3)

comment:1 Changed 13 years ago by brandon

Component: coreevent
Resolution: duplicate
Status: newclosed

Duplicate of #1322

comment:2 Changed 13 years ago by maethorin

Resolution: duplicate
Status: closedreopened

I download the 1.1.3.1 and I can't find the solution proposed in changeset 2193.

the code for 1.1.3.1 is:

if ( event.pageX == null && event.clientX != null ) {
  var e = document.documentElement, b = document.body;
  event.pageX = event.clientX + (e && e.scrollLeft || b.scrollLeft);
  event.pageY = event.clientY + (e && e.scrollTop || b.scrollTop);
}

With this, the bug persists. In the changeset 2193, the code is:

if ( event.pageX == null && event.clientX != null ) {  
   var e = document.documentElement || document.body;  
   event.pageX = event.clientX + e.scrollLeft;  
   event.pageY = event.clientY + e.scrollTop;  
   var e = document.documentElement, b = document.body;  
   event.pageX = event.clientX + (e && e.scrollLeft || b && b.scrollLeft);  
   event.pageY = event.clientY + (e && e.scrollTop || b && b.scrollTop);  
}  

I tested this code of the changeset and it's work for my problem.

Thanks

comment:3 Changed 13 years ago by john

Milestone: 1.1.31.1.4
Resolution: duplicate
Status: reopenedclosed
Version: 1.1.21.1.3

Duplicate of #1402.

Note: See TracTickets for help on using tickets.