Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try the following:</p> <pre><code>&lt;ul class="content_links"&gt; &lt;li&gt;&lt;a href="/historyapi/pages/content_page_1.html"&gt;Content page 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/historyapi/pages/content_page_2.html"&gt;Content page 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/historyapi/pages/content_page_3.html"&gt;Content page 3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/historyapi/pages/content_page_4.html"&gt;Content page 4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="/historyapi/pages/content_page_5.html"&gt;Content page 5&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="content"&gt; &lt;p&gt;Content within this box is replaced with content from supporting pages using javascript and AJAX. &lt;/div&gt; &lt;script&gt; $(function() { // Prepare var History = window.History; // Note: We are using a capital H instead of a lower h if ( !History.enabled ) { // History.js is disabled for this browser. // This is because we can optionally choose to support HTML4 browsers or not. return false; } // Bind to StateChange Event History.Adapter.bind(window,'statechange',function() { // Note: We are using statechange instead of popstate var State = History.getState(); $('#content').load(State.url); /* Instead of the line above, you could run the code below if the url returns the whole page instead of just the content (assuming it has a `#content`): $.get(State.url, function(response) { $('#content').html($(response).find('#content').html()); }); */ }); // Capture all the links to push their url to the history stack and trigger the StateChange Event $('a').click(function(evt) { evt.preventDefault(); History.pushState(null, $(this).text(), $(this).attr('href')); }); }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload