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

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

ubuntu - Bash Script to Check That Files Are Being Created -