View file Podarki_na_Ajax_dc/user/gift/present/page.js

File size: 606B
if(history.pushState){

  $(window).on('popstate', function(event){

      var loc = event.location || ( event.originalEvent && event.originalEvent.location )|| document.location;

      ajaxNav(loc.href);

  });



  $('body').on('click', 'a[data-ajax]', function(){

    var url = $(this).attr('href');

			

    history.pushState(url, $('#title-page').text(), url);

    ajaxNav(url);

    return false;

  });

}

	

function ajaxNav(url){		

  $('#ajax-container').load(url+ ' #ajax-container', function(){

    document.title = $('#title-page').text();

  });

}