Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing page that keeps cached information 2

Status
Not open for further replies.

programmher

Programmer
May 25, 2000
235
US
Can anyone provide me the code that will refresh my page AND keep my cached information?

All the examples I've located thus far do not address cached information. I need to retain the variables associated with my parent/main page.
 
you'll have to store them in a hidden frame, a querystring or a cookie to do this with client-side javascript. jared@aauser.com -
 
Cookies have to remain be turned off so I have to explore your other options of a hidden frame or a querystring. Do you have any examples of either?
 
jsut use a frameset and make a 0 row frame named storage. when you want to persist some info across several pages, you can store things in from your content frame like so:

parent.storage.whatever="somevalue"

and then access them the same way.

The querystring can be used by addding a variable onto the end of the url(i think it can only hold up to 256 bytes by the way):

window.location="nextpage.htm?whatever="+somevalue

And can then be accessed on nextpage.htm like this:

window.location.search.split("=")[1]

Of course, if you need to add more than one value, you need to separate them by '&' signs:

"nextpage.htm?whatever="+somevalue+"&other="+another

and you would have to split on '&'s as well jared@aauser.com -
 
I don't know if this will be of any use but it is how i ensure that my intranet pages auto refresh, it is dirty and probably cheating but it does work.

It generates the URL of the page i wish to go to and adds on to the end of it a 6 digit randomly generated number,( it fools all the browsers into believing it is a brand new unread page.)

Hope it helps.

<script language=vbscript>
x = int(rnd(100000)*100000)
Document.Write &quot;[ignore]<a href=www.mypage.com[/ignore]?t=&quot; & x & &quot;>My Link</a>&quot;
</script>

DeltaFlyer ;-)

DeltaFlyer - The Only Programmer To Crash With Style.
 
well, window.reload(true) forces a reload ... and doesn't display cached variables ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top