Of course, you may have some invisible containers:
HTML
<div id="page">
<a href="page2.html" id="page2-link">Go second page</a>
</div>
<div id="page2">
</div>
CSS
#page2 { display:none }
Javascript
Then, when in javascript, preload the second page after loading it and put it in the invisble container:
$().ready(function(){
$('#page2').load('page2.html #page');
});
And when the link is clicked, just show the hidden container with the selected page and delete another, or just hide so as not to load again when the user wants to return or something like that.
$().ready(function(){
$('#page2-link').on('click',function(){
$('#page').html( $('#page').html() );
});
});