window.history.pushState POC

Load content via XHR into #viewer while allowing bookmarking. Click on the {a, b, c} links below. Content should change in the #viewer and the URL should be updated. Refreshing the page will load the XHR sourced page. If the sourced page has been loaded through XHR no site header will be shown. Viewing the page directly will show a site header.

#viewer

Support

Chrome 9
supported
Chrome 10
supported
facebookexternalhit 1.0
not supported
Firefox 3.5.5
not supported
Firefox 3.6.9
not supported
Firefox 4.0b8
supported
Googlebot 2.1
supported
MSIE 6.0
not supported
MSIE 8.0
not supported
MSIE 9.0RC
not supported
Safari 5
supported
Safari Mobile 4 (Android)
not supported
Safari Mobile 5 (iPod)
supported

HTML

      <li><a href="#!a">a</a></li>

JavaScript

  $('a')
    .bind(
      'click',
      function() { 
        var url = $(this).attr('href').replace('#!', '');
        $('#viewer').load(url); 
        window.history.pushState({}, '', url);
        return false;
      });
    

Background