Search code examples
javascripthtmlstruts2yui

data not updating while clicking on browser back button


I have a page which is displaying some records(news details) each record has a hyper link. The data is coming through Ajax. When I click on a link (news) it is displaying the details of that news in the same window.

Then I deleted that news then I clicked browser back button. Again whatever the news I saw before delete, all those news are displaying.

I am able to see Ajax call at browser console. But, actually the call is not going to action class (I am getting the previous data).

When I click on browser back button. Will the Ajax call go to the action class or not? What will happen when I click on browser back button?


Solution

  • You might be caching the AJAX results. Try using $.ajaxSetup({ cache: false }); before your ajax statement and see if that helps.