By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,141 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

Stop Opera (mobile) caching javascript

P: 2
Hi all,
I have standard AJAX script that calls a php file to load the latest information and uses xmlHTTP.responseText to write it to innerHTML of a div by id. It works fine on IE/firefox, but I'm having trouble with Opera Mobile, due to javascript caching (at least that is my suspicion)

I installed Opera for Windows and had the same problem (described below), until I set the Other Modification setting to 0 in opera.ini (i.e. to set Opera to always run the script). However, this setting doesn't exist in Opera Mobile, and thus I need another solution.

The problem:
The first time the call is made (triggered by onClick), the correct data is returned. However, every subsequent click (which always calls the same function) just returns the same data, and very quickly. This makes me think that it is not calling the php file, just loading the variable or similar from cache.

The question:
What methods can I use to stop Opera Mobile caching the javascript? (i can post code if necessary, but I feel like there should be a generic solution)

Thanks!
Nov 19 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
For the URL, add a date/time at the end, e.g.
Expand|Select|Wrap|Line Numbers
  1. script.php?time=' + new Date().getTime();
Nov 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.