I am trying to bind this submit event from a form which not always be in Dom, so I trying with .on():
$('body').on("form","submit", function(e){})
but firebug logs:
$(“body”).on is not a function
[Parar en este error]$(‘body’).on(“form”,”submit”, function(e){
tried also
$(document).on("form","submit", function(e){})
If you are upgrading to jQuery 1.7, you can use on() by applying
formas a selector, like:$('body').on("submit", "form", function(e){Which will bind the
submitevent tobody, but filtering it toformwhich works the same way as thedelegateexample below.If you are using 1.4.2 or newer, you can use delegate() like this:
$('body').delegate("form", "submit", function(e){