Jquery how to cancel moving to the page send Ajax form?

$('#submit-edit').submit(function (event) {

event.preventDefault();
 var url = $('#form-edit').attr('action');

$.ajax({
 type : 'POST',
 url : url,
 data : $('#form-edit').serialize(),
 success : function(data) {
alert(data)
}
});
 })


Doesn't work (((
June 3rd 19 at 19:10
2 answers
June 3rd 19 at 19:12
Solution
event.preventDefault()
or just return false

Doesn't work (((
Actually works
June 3rd 19 at 19:14
. I have just myself pozabotilsya . Confused id , and even delegated processing needs

Find more questions by tags JavaScript