My problem is,
I have a table that displays the information that has in the database the information entered in the index. And in the index you have the option to add a new record (Modal Ajax), in the file editaagenda.php
has all forms (CRUD) when it returns .done()
success in ajax I call editaagenda.php
to update the hmtl table with updated information I need to display the data list in the index without having to reflesh the page.
And the only way I came to mind was after insert grab the file with $ .get and play in the .read_content div of the index instead of the other to upgrade without reflesh.
My code:
$.ajax({
url: 'add-data.php',
cache: false,
contentType: false,
processData: false,
data: dados,
type: 'post'
}).done(function (data) {
$('#addfrm').modal('hide');
$('#frm')[0].reset();
$.get("editaagenda.php?#read_content", {}, function (data, status) {
$(".read_content").html(data);
});
It would be this way so that it returns only the part of the code in the file editaagenda.php
where it has the div with id="read_content",
but this way I did it is returning every page instead of just the Div with id="read_content".