Greets, Before marking this question duplicate, I would like to tell that I have looked every question that could help me but neither of them does. I have a simple example below, your help will be appreciable. I am a newbie, I have seen many jquery plugins for history management but I am unable to implement. Can you direct me some working example with some modification in my given example.
Example: Index.html page which gives 3 links to different pages, these links are not directed with href but with AJAX. The content of the div is changed without refreshing the page.
Problem: I can not track the history, say I clicked page 2 -> page 3 -> page 2 -> page 1 Now, the client wants to go back to previous page (div content). How is this possible.
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Back button/History Problem</title>
</head>
<body>
<a href="#page1" onclick="showPage('1')" rel="tab">Page 1</a>
<a href="#page2" onclick="showPage('2')" rel="tab">Page 2</a>
<a href="#page3" onclick="showPage('3')" rel="tab">Page 3</a>
<!-- HTML page is added without change in the URL address -->
<div id="content"></div>
<!-- jQuery library -->
<script type="text/javascript" src="js/jquery-1.9.0.min.js"></script>
<script>
function showPage(page) {
$("#content").load("pages/page" + page + ".html");
}
</script>
</body>
</html>
page1.html
<h1>Page 1</h1>
page2.html
<h2>Page 2</h2>
page3.html
<h3>Page 3</h3>