Skip to main content

Bug Tracker

Side navigation

#6418 closed bug (invalid)

Opened April 10, 2010 05:50AM UTC

Closed April 10, 2010 11:40PM UTC

Possible .data() bug when used on a custom plug-in

Reported by: abessa7 Owned by:
Priority: Milestone: 1.4.2
Component: data Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

I was createing a plug-in using the recommended plug-in construct:

(function($){

$.fn.PLUGIN = function() {

return this.each(function() {

});

}

})(jQuery);

In the code I've attached, I have a line that binds data to the plugin:

$(this).data({ Column : Column, Row : Row });

When clicking on the element, I get the following error in IE:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; GTB6.4; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Timestamp: Sat, 10 Apr 2010 05:45:39 UTC

Message: 'undefined' is null or not an object

Line: 55

Char: 143

Code: 0

URI: http://www.webmecompany.com/javascript/jquery-1.4.2.min.js

Can .data() be bound to a plugin's element, or must .data() be bound to an element inside the plugin's "master element"?

Note: I no longer receive the error when I change the .data() line to:

$('uiImageSelector input').data({ Column : Column, Row : Row });

I hope this report helps and/or makes sense, feel free to email me with questions, andrewbessa@gmail.com

Andrew C Bessa

Attachments (1)
  • Code.txt (5.2 KB) - added by abessa7 April 10, 2010 05:50AM UTC.

    General Code

Change History (2)

Changed April 10, 2010 05:53AM UTC by abessa7 comment:1

I meant the changed code (at the end) to read:

$('.uiImageSelector input').data({ Column : Column, Row : Row });

Changed April 10, 2010 11:40PM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

Can you reduce this to the simplest possible test case and reopen the ticket? Thanks.