1

Please, can anyone guide me with this pushState code.

Is there a better way to do this?

Also, it cannot be bookmarkable. Why?

Thank you!

$(function(){
    if (Modernizr.history) {
        wrap = $('#wrap');
        $('a').click(function(event){
           url = $(this).attr('href');
           wrap.load(url + ' #main', function() {
               title = $('#main').find('h1').text();
               $('head').find('title').text(title);
               history.pushState(null, title, url);
           });
       event.preventDefault();
       });
   }
});

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.