I'm having a little trouble using history.js with jQuery. I just wanted to make a navigation set work with the back button (which they do seem to be doing quite nicely). However. When I click the back button the url changes to the old (which again is good and what I want) but the content does not replace as it should.
To make this a little more understandable here's some code.
<ul class="content_links">
<li><a href="/historyapi/pages/content_page_1.html">Content page 1</a></li>
<li><a href="/historyapi/pages/content_page_2.html">Content page 2</a></li>
<li><a href="/historyapi/pages/content_page_3.html">Content page 3</a></li>
<li><a href="/historyapi/pages/content_page_4.html">Content page 4</a></li>
<li><a href="/historyapi/pages/content_page_5.html">Content page 5</a></li>
</ul>
<div id="content">
<p>Content within this box is replaced with content from supporting pages using javascript and AJAX.
</div>
Obviously what I want is the content of the pages load into content which is done nice and easily with .load() and then I want the back button to move backwards through them if the user uses it. At the moment the URLs change but the content in the box does not. How would I go about changing or fixing that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…