Bug Tracker

Ticket #10081 (closed bug: invalid)

Opened 3 years ago

Last modified 3 years ago

jQuery event handler

Reported by: shehriyari Owned by: shehriyari
Priority: low Milestone:
Component: event Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

Description

Line 2965 in jquery.js:

var ret = handleObj.handler.apply( this, args );
if ( ret !== undefined ) {
	event.result = ret;
	if ( ret === false ) {
		event.preventDefault();
		event.stopPropagation();
	}
}

In my code, the value for handleObj.handler property sometimes becomes an array, and thus apply() doesn't work. I get error saying "handleObj.handler.apply() is not a function". Shouldn't there be a control statement, which would check whether handleObj.handler has apply() method assigned to it or not?

You can view my code at:  http://shehi.dyndns.org/acp/components/ .

Press CREATE NEW under Subroutine Management. Select Data-source=Module RDBMS .... Go to just-enabled Data-source tab; there select Fetch Criteria - Queries & Query Groups (Policies) = FETCH SELECTED. You will get the mentioned error... Check console for output...

Change History

comment:1 Changed 3 years ago by shehriyari

In the console, I log event argument that is passed to Event-handler function, which is change-event in my case. All of the SELECTs in the use the same handler function, and if you check the objects in the console, you will see that handler property has a FUNCTION as value, which is correct. But when I "change" the SELECT of Fetch Criteria - Queries & Query Groups (Policies), I get handler = [all]. Shouldn't it be FUNCTION?! Why the value of SELECT is assigned to the handler property?!

Version 0, edited 3 years ago by shehriyari (next)

comment:2 Changed 3 years ago by shehriyari

Last edited 3 years ago by shehriyari (previous) (diff)

comment:3 Changed 3 years ago by rwaldron

  • Owner set to shehriyari
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to event
  • Milestone changed from None to 1.6.3

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket! We do appreciate you providing the above link.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate:  http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:4 Changed 3 years ago by shehriyari

  • Status changed from pending to new

@rwaldron: I can't give you reduced test case, because this particular situation only happens in 2 of my SELECTs I mentioned above. If I could narrow down the cause, I would've solved it myself :) I know it is weird, but we will have to dig into this dirty case using the example I provided... Sorry for being unhelpful :(

comment:5 Changed 3 years ago by shehriyari

Guess this one won't get noticed because of my very big "sample", am I right? :( . I am open-source developer working on my CMS software, and I really would appreciate any help on this matter. My code is both in  Google Code Eclipse Labs and  Github. Thanks for any help in advance!

comment:6 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid
  • Milestone 1.6.3 deleted

Sorry but there isn't enough information here to reproduce or check the bug. It's possible this is a dup of #9593 which should be fixed in 1.7.

comment:7 Changed 3 years ago by postbin@…

I have the same bug in my app with Jquery 1.7.1 I attached change handler to input: text element. And when text is changed there is this error (at least i when i try in firefox 9). At other places in my code the handler works normally.

comment:8 Changed 3 years ago by desi@…

I've got the same problem using the latest version of JQuery.

 http://jsfiddle.net/ayXy7/

comment:9 Changed 3 years ago by dmethvin

@desi,

$('.subnav li .level-1').hover('touchstart', function(e) {

There is no signature of .hover() like this. Please ask for help on the forum or StackOverflow.

Note: See TracTickets for help on using tickets.