1

I have a set of data on my home page as a result of Ajax response..clicking on any of the data will guide me to another page .but whenever i click the back button of the browser it guides me to the home page , not showing the ajax data..is there anyway to act ajax data as session or something ???

Naveed
  • 41,517
  • 32
  • 98
  • 131
coolguy
  • 7,866
  • 9
  • 45
  • 71

2 Answers2

1

Use jQuery History Plugin

Sample Code:

function callback(hash) {
    // do stuff that loads page content based on hash variable
}

$(document).ready(function() {
    $.history.init(callback);
    $("a[@rel='history']").click(function(){
        $.history.load(this.href.replace(/^.*#/, ''));
        return false;
    });
});

More Solutions:

Community
  • 1
  • 1
Naveed
  • 41,517
  • 32
  • 98
  • 131
0

I would say you should make another call when you click back on home page. By storing on a page with jquery, you are compromising with security. See this jQSession. Try to invoke ajax call again since Ajax is fast anyway. All the session data should be handled by a server side script.

Community
  • 1
  • 1
A_Var
  • 1,056
  • 1
  • 13
  • 23