我知道在第一个版本中有一个.data('events'). More recently it was put away on
$ ._ data('events',$ obj)`。
所有这些似乎都无法在jQuery 3.3.1上运行。
在新版本中如何使用?
这是一个例子:
$('#tplProcesso').on('init', function (e) {
//...
});
let test1 = $('#tplProcesso').data(events); //undefined
let test2 = $._data($('#tplProcesso'), 'events'); //undefined
let test3 = $._data($('#tplProcesso')[0].events);
jquery-3.3.1.js:4015 Uncaught TypeError: Cannot read property 'jQuery331083194960171497261' of undefined
at Data.cache (jquery-3.3.1.js:4015)
at Data.get (jquery-3.3.1.js:4066)
at Data.access (jquery-3.3.1.js:4087)
at Function._data (jquery-3.3.1.js:4237)
at <anonymous>:1:3
cache @ jquery-3.3.1.js:4015
get @ jquery-3.3.1.js:4066
access @ jquery-3.3.1.js:4087
_data @ jquery-3.3.1.js:4237
(anonymous) @ VM7170:1
let test4 = $._data($('#tplProcesso').events);
jquery-3.3.1.js:4015 Uncaught TypeError: Cannot read property 'jQuery331083194960171497261' of undefined
at Data.cache (jquery-3.3.1.js:4015)
at Data.get (jquery-3.3.1.js:4066)
at Data.access (jquery-3.3.1.js:4087)
at Function._data (jquery-3.3.1.js:4237)
at <anonymous>:1:3