Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery.data() and cross browser compatibility?

Tags:

I want to use the jQuery.data() method to attach data to a DOM object as an alternative to storing it in an attribute.

The method seems perfectly suited to my needs, but in the jQuery docs (http://api.jquery.com/jQuery.data/), there's this line:

Note that this method currently does not provide cross-platform support for setting data on XML documents, as Internet Explorer does not allow data to be attached via expando properties.

Does this mean the method won't work in IE? In my testing the method works fine with IE8 on Windows 7, but I don't want to run into issues with any browsers.

Thanks.

like image 647
Giorgio Avatar asked Jan 31 '11 19:01

Giorgio


People also ask

Is jQuery cross-browser compatible?

Cross-browser compatibility — jQuery supports older browsers which do not do well with modern tools, frameworks or libraries. jQuery-powered applications work well on all browsers.

Does jQuery work in IE8?

1 Answer. Show activity on this post. IE8 support was dropped in jQuery 2. x, so you will want any version beginning with 1 that satisfies your plugin's version dependencies.

Does jQuery 2.0 support IE?

Those improvements come at a price, though: jQuery 2.0 won't support Internet Explorer 6, 7, or 8. At the same time, the jQuery team will stop supporting jQuery 1. x in an array of environments, including apps for Firefox OS, Chrome OS, Windows 8 Store, and BlackBerry 10 WebWorks apps.


1 Answers

Notice the

... for setting data on XML documents ...

As long as you're working with HTML I think you should be fine

like image 154
hackerhasid Avatar answered Oct 10 '22 19:10

hackerhasid