Skip to main content

Bug Tracker

Side navigation

#1168 closed bug (fixed)

Opened May 11, 2007 04:08PM UTC

Closed May 11, 2007 09:17PM UTC

Last modified October 14, 2008 10:50AM UTC

SVN: "Error: this.$events has no properties" when using e.g. click()

Reported by: blueyed Owned by:
Priority: major Milestone: 1.1.3
Component: event Version:
Keywords: Cc:
Blocked by: Blocking:
Description

Something seems to have broken recently in SVN (after 1.1.2).

I'm getting:

Error: this.$events has no properties
Source File: file:///XXX/jquery.js
Line: 2904

This line is:

var c = this.$events[event.type], args = [].slice.call( arguments, 1 );

I've fixed it like below, but probably the real problem is that this.$events is not initialised before.

--- /jquery/src/event/event.js	(Revision 1883)
+++ /jquery/src/event/event.js	(Arbeitskopie)
@@ -157,6 +157,10 @@
 		// Empty object is for triggered events with no data
 		event = jQuery.event.fix( event || window.event || {} ); 
 
+		// return if there are no events registered from us. This happens when triggering input.click() since after jQuery 1.1.2 (nightly build from 2007-05-05)
+		if(!this.$events)
+			return val;
+
 		var c = this.$events[event.type], args = [].slice.call( arguments, 1 );
 		args.unshift( event );

This happens with SVN r1883 and the following test page:

<html>

<head>
<script type="text/javascript" src="jquery.js"></script>
</head>

<body>
<form onsubmit="alert('submitted.'); return false;">
    <input type="submit" id="submit" value="submit" />
</form>

<script type="text/javascript">
$("#submit").click();
</script>

</body>
</html>
Attachments (0)
Change History (1)

Changed May 11, 2007 09:17PM UTC by brandon comment:1

resolution: → fixed
status: newclosed

Fixed in Rev [1885].