javascript - Backbone.js - Remove standard submit event -
i handle submit event of form so:
events: { 'submit #contactus-form': 'submit' }, ... submit: function() { alert("handle"); },
but though after seeing alert page refreshes , adds url:
?name=&email=&text=
how prevent standard behavior? leaving handler.
this because submiting can use event.preventdefault prevent this. try code:-
submit: function(e) { e.preventdefault(); alert("handle"); },
Comments
Post a Comment