Click here to Skip to main content
15,896,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a html page whose content is generated using ajax call on page load.
So when the page is requested the content is visible. But when I go to the next page and then click browser back button then the content is lost.
Can you help me to retain the content in the same scenario.
Thanks

What I have tried:

I am using ajax call then assigning the output to a div using
$('#doc-content').html(data);
Posted
Updated 16-Feb-16 23:33pm
v3
Comments
Sinisa Hajnal 17-Feb-16 6:05am    
Enable caching? So that back button returns the page.

Alternate: on each ajax call alter the URL in some small way and recreate the page depending on the parameters

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900