I have an ajax function (in jquery) which update the html. It's ok.
Now, When I tap enter in the adress bar (to refresh), my html is not updated (old content).
Whereas, when I do cmd + R
, my html is always ok.
What is the problem ? Why my content shows old content from the adress bar ?
Edit :
I use Chrome
et load()
in jQuery
Insert following lines within "head" tag as follows,
Providing more details will help. I think your ajax code is not working. May be it is fetching the data but not updating the page proeprly. Try checking th error console if you are in firefox. It should show you any errors if you are getting in updating the content.
Try using fiddler to find out what you are actually fetching using ajax. There are many things which can happen here and will make it fail.
Use this, after jQuery has been loaded
For more information, check the documentation for jQuery.ajaxSetup
This function uses the same options that are passed to jQuery.ajax() method.
Please note that this will disable caching for all jQuery ajax requests.
If you have problem with caching in the browser itself, you need to set header to prevent caching in your Server Side's Code (e.g. Php, Java, Python .....etc).
But if you want to avoid caching in your Ajax Function use this Code:
Notice: Give more details on your question to get a sharper answer.
Use:
Cntl/Cmd + Shift + R
To ignore the cache in Chrome.