Bug Tracker

Modify

Ticket #5265 (closed bug: invalid)

Opened 4 years ago

Last modified 15 months ago

jQuery.fn.data does not always behave in IE

Reported by: stephenr85 Owned by:
Priority: major Milestone: 1.4
Component: data Version: 1.3.2
Keywords: Cc:
Blocking: Blocked by:

Description

I'm working on a project that uses a custom "Repeater" and "Accordion" class. The Repeater allows users to add or remove items, so the elements that represent the repeater's data are created dynamically. The Accordion class associates an expandable area with it's trigger using jQuery.data.

For example: j(section).data("Accordion.trigger", trigger)

This seems to work fine in Firefox, and doing a trace in IE shows that there is a DOM element stored there, but changing its properties has no effect.

I am working around this right now using a little plugin I wrote called jQuery.fn.dataDirect. This basically just stores the trigger reference as a property directly on the element. Storing and retrieving the section/trigger pairs works properly like that, so there is some disassociation going on in IE.

Change History

comment:1 Changed 4 years ago by stephenr85

Here is the code for the dataDirect plugin:

jQuery.fn.dataDirect=function(name, value){

for(var e=0; e<this.length; e++){

if(value==null && this[e][name]!=null && this[e][name]!=undefined)

return this[e][name];

else

this[e][name]=value;

} return this;

}

comment:2 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

Can you reopen this with a complete test case? Or you could ask for help on the forum.

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.