0

I am using a ajax called pages and trying to make the browser's "back" and "forward" buttons work.

These are the handlers:

<li><a href="#" class="ceni">примерни цени</a></li>
<li><a href="#" class="karieri">кариери</a></li> 

And this is my javascript that calls the pages to appear without reloading the whole page(the ajax ):

$('.ceni').click(function(){             
    $.ajax({
    url: 'pages/ceni.php',
    success: function(response) {
    $("#pages").html(response);
    }
     });    
  });



  $('.karieri').click(function(){           
    $.ajax({
    url: 'pages/karieri.php',
    success: function(response) {
    $("#pages").html(response);
    }
     });        
  });

Note: I am not a specialist or something, so please talk to me simply as you can. Thanks a lot :)

Bat Jeko
  • 49
  • 6

1 Answers1

0

I recommend you to look at the History.js plug-in. It does what you want to do and supports jQuery. You can find it at this address :

https://github.com/browserstate/history.js/

I hope it helped you.

thomas.winckell
  • 1,217
  • 1
  • 10
  • 16