In the past following worked perfectly:
$(this + ":submit").live('click', function (e) {
});
but I just started using JQuery 1.8.1 and I get following error on the selector $(this + ":submit"):
Error: Syntax error, unrecognized expression: [object Object]:submit
‘this’ is a jquery select on the id of the form $('form1') and results in [ form#form1 ]
What could be an alternative syntax that works with Jquery 1.8.1 and previous versions of Jquery ?
You have to supply
thisas contextwhich is equivalent to
I would suggest the latter since it makes things more readable.
UPDATE: Just to clarify, I’m editing in @Esailija’s comment –