php - Remove records without reloading the page with AJAX -



php - Remove records without reloading the page with AJAX -

when delete record database ajax think should seek reloading page until page deleted there way solve problem, there

this jquery code

jquery(document).ready(function ($) { $('#del>a').click(function(){ $.post( 'ajax.php', { delid:$(this).next('input').val() }, function(data) { $('#result').html(data); }) }) });

this php code

if(isset($_post['delid'])) { $id = mysql_real_escape_string($_post['delid']); $admin->deleteitem($id,'news'); }

if(isset($_post['delid'])) { $id = mysql_real_escape_string($_post['delid']); $del = $admin->deleteitem($id,'news'); if($del) { echo "deleted"; } }

not function(data) success: function(data)

success: function(data) { if(data=="deleted") { $(this).hide(); } },

php jquery ajax record delete-record

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -