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

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

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