I am developing a jquery mobile application that loads external pages into a div by clicking a link,
external pages that I call in the div also have links to other pages.
when I click on these links to other pages and I use the back link ("javascript:history.back()") to go
on the previous page on which the external page was, the external page disappears if I do not click on the link that calls the external page to load
page again. I thought that maybe this is a script that can cache the loaded page, so when I use
the back link ("javascript:history.back()") to return again, I will find the page there.
here is the script that I use to load the external page:
$(document).ready(function() { $('.newsclick').on('click', function(event) { $('#headline_container').load('news/headlines.asp'); }); });
HTML
<div data-role="page" id="news"> <div data-role="header"> <h1>News</h1> </div> <div id="headline_container" data-role="content">Content</div> <div data-role="footer"> <h4>Footer</h4> </div> </div>
source share