jQuery normalizes this, you can reliably call .preventDefault(), for example:
$("#admin_main").delegate("#create_user_form", "submit", function (event) {
event.preventDefault();
$.post('create_user', $("#create_user_form").serialize(), function (data) {
$("#admin_main").html(data);
}, "html");
});
Or, if you want to completely kill the event return false:
$("#admin_main").delegate("#create_user_form", "submit", function () {
$.post('create_user', $("#create_user_form").serialize(), function (data) {
$("#admin_main").html(data);
}, "html");
return false;
});
The reason this is not a problem is because it is not a browser-specific event object that you are dealing with, it is a jQuery event object that has normalized behavior.
source
share