Good day! Help to overcome the problem with ajax. There is such a function

function ajax_message_delete(id, zadanie_id) { $.ajax({ url: "/ajax_script/messages_window.php", type: "POST", data: 'action=delete_message&id=' + id + '&zadanie_id=' + zadanie_id, success: function (data) { if (data) { $('.infrsend').html(data); $('#center_box').slimScroll({ height:150, start : 'bottom' }) ; } } }); 

}

After processing, a strange addition to the result is displayed, the screen by reference.

Imgur

Processing in php (and it doesn't matter what happens with the response from the server side, you can just send "1"):

  if ($action == 'delete_message' && $id > 0 && $zadanie_id > 0) { //Ссли Π°Π΄ΠΌΠΈΠ½ if($moderator['status'] == 'admin' || $moderator['funct'][13] == 1) { //q("delete from `users_messages` where `id` = '$id'"); $messages = load_messages_window(0, $zadanie_id, 1); } //* //Ссли Π½Π΅ Π°Π΄ΠΌΠΈΠ½ else { //ΡƒΠ·Π½Π°Π΅ΠΌ с ΠΊΠ΅ΠΌ ΠΌΡ‹ ΠΎΠ±Ρ‰Π°Π»ΠΈΡΡŒ $q = q("select `user_to` from `users_messages` where `user_form` = '" . $_SESSION['user'][0] . "' and `id` = '$id'"); $user_to = mysql_fetch_row($q); //* q("delete from `users_messages` where `user_form` = '" . $_SESSION['user'][0] . "' and `id` = '$id'"); $messages = load_messages_window($user_to[0], $zadanie_id); } //* echo '<div class="center_box" id="center_box">' . $messages . '</div>'; } 
  • what is going on there on the server side? show the code - mountpoint
  • Your answer comes in json format. Apparently you really got rid of the wrong piece of code that runs on the server. - lampa

0