Getting this error:
Uncaught TypeError: Object [object Object] has no method 'live'
From this JavaScript and jQuery code:
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;
};
Why is method live
missing?
.live
was removed in jquery 1.9
See DOCs: http://api.jquery.com/live/
Try using .on
instead:
$(document).on('click', '.formError', function(){
//your event function
});
According to the documentation, .live()
has been deprecated since 1.7 and removed in 1.9.
You would either have to downgrade jQuery or use a newer version of the validation plugin, if it's available.
.live() removed
The .live() method has been deprecated since jQuery 1.7 and has been removed in 1.9. We recommend upgrading code to use the .on() method instead.
To exactly match
$("a.foo").live("click", fn)
You should write
$(document).on("click", "a.foo", fn).
For more information, see the .on() documentation. In the meantime, the jQuery Migrate plugin can be additionally used to restore the .live() functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With