2

This is weird behavior but when I am trying to access some data attribute using jQuery data() function, it is returning me undefined but attr() is returning me the actual value. I know data works differently as it caches for the first time and then it retrieves from cache. I am using jQuery 1.4.2 and then tried looking with jQuery 1.7.1 and it did work. But I can't upgrade to 1.7.1 at the moment. Any thoughts on it??

I will appreciate any kind of suggestion or help provided

4

2 に答える 2

4

プルされるHTML5data-*オブジェクトは.data、jQuery 1.4.3まで実行されませんでした:http://api.jquery.com/data/#data-html5

たぶんあなたはただ1.4.3にアップデートすることができますか?

于 2012-08-29T18:33:18.300 に答える
0

あなたはあなた自身の質問に答えました:datajQuery1.4.2では機能しません。アップグレードできない場合は、このプラグインを試してください。

于 2012-08-29T18:40:32.023 に答える