Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#11437 closed bug (worksforme)

((f.event.special[r.origType] || {}).handle || r.handler).apply is not a function

Reported by: cowwoc@… Owned by:
Priority: low Milestone: None
Component: event Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description

FireFox 10.0.2 throws "((f.event.special[r.origType]
{}).handle r.handler).apply is not a function" for the following test-case:
<!DOCTYPE html>
<html>
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

		<script type="text/javascript" src="https://www.google.com/jsapi"></script>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
		<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
		<script type="text/javascript">
			$(function() {
				$("#calculator").dialog(
				{ 
					title: "Please enter the following information",
					width: 500
				});
				
				$("#income").change($(function(event)
				{
					console.log(event);
				}));
			});
		</script>
	</head>
	<body>
		<div id="calculator">
			Income$<input id="income" pattern="^\d+((\.|\,)\d{2})?$"/>
		</div>
	</body>
</html>
  1. Select input field.
  2. Enter any number.
  3. Hit TAB.
  4. Exception thrown.

Reproducible always.

Change History (2)

comment:1 Changed 6 years ago by addyosmani

Component: unfiledevent
Priority: undecidedlow
Resolution: worksforme
Status: newclosed

Rather than passing $(function(event){ ... }) to el.change(), simply pass function(event){..} as follows (and as defined by our docs) and you won't experience any exceptions when tabbing. http://jsfiddle.net/mprQp/1/. Your console.log will work absolutely fine and there's no (as far as I can discern) reason to be wrapping your callback with $ here.

comment:2 Changed 5 years ago by anonymous

I got the same exception when I had this line code: $x = $("table").select('tbody'); I know now that this is a very stupid line of code, but the error message from firefox is not really useful. My solution was to remove this line of code.

Note: See TracTickets for help on using tickets.