-1
var data = $('.t-grid-header-wrap tr').data();

Will these kind of references to .data work in jquery1.9, I have a few of them in telerik js files, was unclear whether its removed or only .data("events") has been removed?

KeenUser
  • 5,305
  • 14
  • 41
  • 62

2 Answers2

3

Yes it will work in 1.9, only some interal structures like events are removed from .data() so that they are not accidentely manipulated.

You can still use jQuery._data()

$._data(domElement, 'events')

Demo: Fiddle

Community
  • 1
  • 1
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531
  • Undocumented arguments of API methods Prior to 1.9, several API methods had undocumented arguments that changed their behavior and created the potential for accidental misuse or incorrect duck punching. These arguments have now been removed. Affected methods include jQuery.data(), jQuery.removeData(), and jQuery.attr(). The jQuery Migrate plugin does not support these undocumented arguments because the refactored code no longer requires it. Now what is this referencing to? – KeenUser Mar 12 '14 at 10:58
  • @AdarshK look at the [.data()](https://github.com/jquery/jquery/blob/1.8.3%2B1/src/data.js#L30) and [.removeData()](https://github.com/jquery/jquery/blob/1.8.3%2B1/src/data.js#L124) signature, it has a `pvt` param which is no longer supported and was an undocumented feature for internal jQuery purpose. I think they meant those options – Arun P Johny Mar 12 '14 at 11:04
0

As you can read in the jquery documentation:

Prior to jQuery 1.4.3 (starting in jQuery 1.4) the .data() method completely replaced all data, instead of just extending the data object. If you are using third-party plugins it may not be advisable to completely replace the element's data object, since plugins may have also set data.

giammin
  • 18,620
  • 8
  • 71
  • 89