sydcanem / bootstrap-contextmenu

Context menu plugin for Twitter's Bootstrap framework
http://sydcanem.com/bootstrap-contextmenu/
645 stars 193 forks source link

.data vs .attr #17

Closed DR9885 closed 11 years ago

DR9885 commented 11 years ago

Because you use .attr('data-target') if I dynamicly add .data('tartget', val) the plugin ignores the value... may want to switch it to checking .data('target').

dariusclay commented 11 years ago

That's the difference between html5 data-* attributes and the object values stored on the dom element, both of which jQuery can access in the samw manner. Use the $().attr("data-target", value) to set a value On Apr 3, 2013 1:39 PM, "Daniel P. Rossi" notifications@github.com wrote:

Because you use .attr('data-target') if I dynamicly add .data('tartget', val) the plugin ignores the value... may want to switch it to checking .data('target').

— Reply to this email directly or view it on GitHubhttps://github.com/sydcanem/bootstrap-contextmenu/issues/17 .

sydcanem commented 11 years ago

Be careful when dynamically changing the data-target attribute it might cause memory leaks in IE.