There are many questions on this, but no answer seems to work easily.
I have a <form> with delete icons on each line. Now .on('click',functoin().. I have an ajax request, for example:
$.ajax({ type:"POST", url:"/update_rows.php", data:"delete_id="+$(this).attr("row"), success:function(data) { if(data) { //window.location.reload(true); //alert(data); $(".refresh-after-ajax").load("/cms/modules/mod11/inc/modinclude_admin.php .refresh-after-ajax"); } else { //window.location.reload(true); } } });
This works, and update_rows.php looks like this:
<?php require_once($_SERVER["DOCUMENT_ROOT"].'/cms/inc/config.inc.php'); global $navid,$DB_PRE,$lang_cms; $db=new DB(); $sql='Delete FROM '.$DB_PRE.'_mod_ref_pricing WHERE id='.intval($_POST['delete_id']); $db->query($sql); ?>
Now I do not want to use window.location.reload(true); because I just want to update this container where the row was deleted. As you do not see, I tried with .load() reload only <div/> , but no chance. alert(data) empty because I am not returning anything from update_rows.php , but why should I return there to update <div/> ?
Thanks for the tips!
source share