Anonymous
Привязка jQuery к отправке формы
Сообщение
Anonymous » 20 окт 2024, 00:56
Я делаю следующее:
Код: Выделить всё
// Post to the server
$.ajax({
type: 'POST',
url: $("form.edit_item").attr("action"),
data: $("form.edit_item").serialize(),
success: function(e) {
}
});
$(".edit_item")
.bind('ajax:loading', function() {
alert('go');
})
.bind('ajax:success', function(data, status, xhr) {
alert('going');
})
});
В форме:
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/4294221/jquery-binding-to-a-form-submit[/url]
1729374978
Anonymous
Я делаю следующее: [code] // Post to the server $.ajax({ type: 'POST', url: $("form.edit_item").attr("action"), data: $("form.edit_item").serialize(), success: function(e) { } }); $(".edit_item") .bind('ajax:loading', function() { alert('go'); }) .bind('ajax:success', function(data, status, xhr) { alert('going'); }) }); [/code] В форме: [code] Подробнее здесь: [url]https://stackoverflow.com/questions/4294221/jquery-binding-to-a-form-submit[/url]