Please help me add history to this AJAX
Hello! I'm a moderate user of jquery and have used it quite frequently to make AJAX calls. However, I'm stumped by this one. I need to keep my current structure but add history / browser back support. I've looked at the history plugin among others. I just can't seem to make anything work.
I'm using a basic ajax call that loads all links throughout the entire website. I need to add history support to that somehow.
Any help is greatly appreciated!
Here's the code:
- $(document).ready(function(){
- $('a').live('click', function(){
- var url = $(this).attr('href');
- if(url.match('^http')){
- return true;
- } else {
- $('#header').fadeOut("fast");
- $('#content').fadeOut( "fast", function() {
- $("#container").append("<div id=\"content\"><div id=\"loader\">Loading<br/><span id=\"loaderimage\"></span><br/><br/><div id=\"error\">Not loading?</div><a id=\"cancelrequest1\" href=\"#\">Back to Dashboard</a><br/><a id=\"cancelrequest2\" href=\"#\">Back to Login</a></div></div>");
- });