OOPS! $('.btn').click( function() { //sendAjaxForm('result_form', 'ajax_form', 'action_ajax_form.php'); //alert('#result_form'); $.ajax({ url: 'action_ajax_form.php', //url страницы (action_ajax_form.php) type: "POST", //метод отправки dataType: "html", //формат данных data: $(this).serialize(), // Сеарилизуем объект success: function(response) { //Данные отправлены успешно result = $.parseJSON(response); alert('ok#result_form' + result.idf); $('#result_form' + result.idf).html('Ok!'); }, error: function(response) { // Данные не отправлены $('#result_form' + result.idf).html('Ошибка.'); alert('bad#result_form' + result.idf); } }); return false; } );