Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jlewis2k1

macrumors 6502a
Original poster
Jan 14, 2005
718
0
in your closet
ok so i have looked at numerous tutorials and im trying to figure out how to get my little ajax script to auto update like every 30 or so seconds... any ideas?
 
ok so i got it to kind of work with

Code:
<script>
window.setInterval("ahah('Live/lefcon','lefcon')", 2000);
</script>

but its not updating. how can i get it to clear its cache so it can retrieve the current data?
 
posting the whole script might help more. and what leads you to believe you need to clear cache? also, you say it's kind of working but it won't update. i thought the whole purpose of this was to get it to update. how is just kind of working?

you might also want to use a javascript debugger. google it and it will come. there is a really good one for firefox. it is an invaluable tool for all but the most basic javascript implementations.
 
Just another word of advice, if you are using https connection, together with dynamically generated XML. You might want to set the header to no-cache as there is a problem with caching of XML document especially using Windows IE
 
If this is happening in IE for Windows, then you might want to include a random query string on the end of your URL that you call every so many seconds. I had a similar problem and IE for Windows is dumb and caches the first XML response unless you do this. So add "?rand=123456789" or something to the URL (which is different every time you call it) for your XMLHttpRequest or do what someone else said and try the <meta> tags for caching and such.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.