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
Post a Comment