I'm doing a GED system here for the company where I work (very simple, just to organize better).
I'm developing the screens first, then connecting to the DB and making things work.
I have a menu that is left with the links to navigate between the pages. On the right I insert the contents of the pages into a DIV called #conteudo
, for this I am using the load()
function of jQuery. As below:
// Carrega o conteúdo das páginas dentro da div#conteudo
$('.carrega_pagina').click( function(){
var href = $(this).attr('href'); // pega o valor do atributo href da âncora clicada
$('#conteudo').load(href);
return false;
});
This has worked fine, however, when clicking on the links about 8-10 times or more, the requested screen takes time to appear (it is as if the browser has been crashing), in addition, the browser consumes up to 70% of the CPU when I request a page (remembering that this only occurs after browsing several times between the pages, when I give a refresh on the page everything returns to normal).
I wanted to know if there is a better way to embed the contents of the other pages in this DIV.