1

I'm trying to load a div into my page when an internal link is pressed and push a history state so that the location changes. I'm also trying to get the page to load the previous div on popstate. I can't seem to get anything working, not even the return false but I know that jQuery is being included since I can use it on another part of my page. Does anyone know what could be wrong?

$(document).ready(function() {
    $("a:not([href^='http://'])").click(function() {
        history.pushState({ path: this.path }, '', this.href);
        $('#innercontents').load(location.pathname + ' #innercontents');
        return false;
    });
    $(window).bind('popstate', function() {
        $('#innercontents').load(location.pathname + ' #innercontents');
    });
});
Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162
Valli
  • 267
  • 1
  • 2
  • 9

0 Answers0