469,330 Members | 1,199 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

Stop Opera (mobile) caching javascript

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)

Nov 19 '07 #1
1 1420
16,027 Expert Mod 8TB
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.

Similar topics

6 posts views Thread by Stefan Mueller | last post: by
reply views Thread by spolsky | last post: by
1 post views Thread by spolsky | last post: by
8 posts views Thread by FAQ server | last post: by
3 posts views Thread by Ilkka Maatta | last post: by
2 posts views Thread by aeroguy | last post: by
4 posts views Thread by Geoff Cox | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.