Bug Tracker

Modify

Ticket #10576 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

jQuery1.7rc1 and jQueryMobile1.0rc2 - IE gets error in jqm triggerCustomEvent method

Reported by: mmcgrath@… Owned by: dmethvin
Priority: blocker Milestone: 1.7
Component: event Version: 1.7rc1
Keywords: Cc:
Blocking: Blocked by:

Description

I'm using jqm 1.0rc2 and jquery1.7rc1

Switched from jQuery 1.6.1 to 1.7rc1, and IE started throwing "SCRIPT5007: Unable to get the value of the property 'call': object is null or undefined".

A small bit of debugging led me to jQueryMobile's "triggerCustomEvent" method:

function triggerCustomEvent( obj, eventType, event ) {
  var originalType = event.type;
  event.type = eventType;
  $.event.handle.call( obj, event );
  event.type = originalType;
}

It looks like the problem is $.event doesn't have an object 'handle'.

Examples:

jQueryMobile1.0rc2 & jQuery1.6.1  http://jsbin.com/imehat/5

jQueryMobile1.0rc2 & jQuery1.7rc1  http://jsbin.com/imehat/4

(I submitted the ticket here rather than in jqueryMobile because all I changed was jQuery, and the error showed up...)

Change History

comment:1 Changed 2 years ago by rwaldron

  • Owner set to mmcgrath@…
  • Priority changed from undecided to high
  • Status changed from new to pending
  • Component changed from unfiled to event
  • Milestone changed from None to 1.7

It's possible that the jQuery Mobile team hasn't update to support jQuery 1.7rc1 (release _candidate_ 1). Can you confirm their release notes?

comment:2 Changed 2 years ago by addyosmani

@rwaldron The jQM team are currently recommending the use of 1.0RC2 with 1.6.4 as opposed to 1.7RC1. I don't believe they've updated support to cover this release just yet.

comment:3 Changed 2 years ago by rwaldron

Thanks Addy. I'll leave this open for now - it might become an real issue when they get to updated.

comment:4 Changed 2 years ago by dmethvin

  • Owner changed from mmcgrath@… to dmethvin
  • Priority changed from high to blocker
  • Status changed from pending to assigned

jQuery.event.handle isn't part of the documented interfaces, it's now jQuery.event.dispatch. I'll talk with the jQuery Mobile guys, it seems like this should be done with jQuery.fn.triggerHandler or perhaps jQuery.event.simulate which is new to 1.7. We'll work something out.

comment:5 Changed 2 years ago by Dave Methvin

  • Status changed from assigned to closed
  • Resolution set to fixed

Fix #10576. Add alias for jQuery.event.handle so voyeur code still works.

Between new 1.7 special event hooks and jQuery.event.simulate() we have a much cleaner solution than the people calling jQuery.event.handle are doing, but we shouldn't break their use of this undocumented internal interface for now.

Changeset: 35bc30cd87c0578359c3127033dd85e1af132f69

comment:6 Changed 2 years ago by dmethvin

#10583 is a duplicate of this ticket.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.