0
I would like to be able to display various contents (from other pages) on a single page for each click on a link or button that the user gives. I know one of the solutions would be to use AJAX, but the problem is that when I do refresh, the content that is visible at the moment disappears and goes back to the main page, what I would like is to remain on the same page with the same content before the refresh.
The Javascript code I use is this:
$.ajax({
url : './pagina.php',
type : 'POST',
cache: false,
data : 'dado=' + dado,
beforeSend: function () {},
complete: function () {},
success: function(data){
$('#showInfo').html(data); // $('# showInfo').show();
},
error: function(){
// comandos a serem executados caso Houver algum
});
Another one I’ve also used is:
$.get("pautas.php?acao=1", function( data ) {
$('#content').html(data);
});
Can someone please give me a hint???