Fra*_*sca 16 jquery object jquery-validation-engine
得到此错误:
Uncaught TypeError: Object [object Object] has no method 'live'
Run Code Online (Sandbox Code Playgroud)
从这个JavaScript和jQuery代码:
init: function(options) {
var form = this;
if (!form.data('jqv') || form.data('jqv') == null ) {
options = methods._saveOptions(form, options);
// bind all formError elements to close on click
$(".formError").live("click", function() {
//Getting error here:
//Uncaught TypeError: Object [object Object] has no method 'live'
});
}
return this;
};
Run Code Online (Sandbox Code Playgroud)
为什么方法live
丢失了?
Nea*_*eal 32
.live
在jquery 1.9 中删除了
见DOC:http://api.jquery.com/live/
请尝试使用.on
:
$(document).on('click', '.formError', function(){
//your event function
});
Run Code Online (Sandbox Code Playgroud)