View previous topic :: View next topic |
Author |
Message |
carriehoff
Joined: 24 Feb 2006 Posts: 1
|
Posted: Fri Feb 24, 2006 3:25 pm Post subject: refresh page just one time -- not at intervals |
|
|
Hi,
I recently read a post on this message board in which a user asked how to refresh a page, but at 30 second intervals.
I need to refresh a page - just one time - when the page loads. It's for when users change out pictures on one of my websites. They can't view the most recent pic unless they use the refresh button.
I even have the page set to not cache, but still have the problems with the pic. If a manual right-click, and then 'refresh' will solve the problem, there must be a way to do it with code. I just haven't found it yet. Anyone else?
Thanks,
Carrie |
|
Back to top |
|
|
administrator Site Admin
Joined: 01 Oct 2004 Posts: 183
|
Posted: Fri Feb 24, 2006 3:50 pm Post subject: |
|
|
You can do something like that:
<script>
function RefreshOnce() {
var sRefreshed = "<%=Request.QueryString("refreshed")%>";
if(sRefreshed == "") {
document.location = document.location + "?refreshed=yes";
}
}
</script>
<body onload="RefreshOnce()">
I haven't tested it, but something like that should work.
Let me know how it goes? _________________ Peter
ASP & ASP.NET Articles and Tutorials |
|
Back to top |
|
|
bigbrain28
Joined: 16 Mar 2006 Posts: 4 Location: Spring Hil, Florida
|
Posted: Thu Mar 16, 2006 1:01 pm Post subject: How about a submit on reload? |
|
|
I am trying to modify your snippet to do this;
I have a form element that reloads and submits when you choose a name from the select list, but then the user needs to submit the newly valued form. So its like a 2 step process, when it could be one. How would I use this code to resubmit (once) a page form if the selection/reload had been done?
I am currently messing with;
Code: | <script>
function RefreshOnce() {
var sRefreshed = "<%=Request.Form("rf")%>";
if(sRefreshed == "") {
document.forms[0].submit();
}
}
</script> |
Where "rf" is a hidden field in the form. It does not work as hoped...
Thanks! _________________ Beware the n00b...Hey, thats me! |
|
Back to top |
|
|
bigbrain28
Joined: 16 Mar 2006 Posts: 4 Location: Spring Hil, Florida
|
Posted: Thu Mar 16, 2006 2:34 pm Post subject: |
|
|
Ok - I have a concept regarding this, pplease tell me if this should work. My page needs to be reloaded (re submitted) because 2 variables need to be the same for a map to display.... So if I check that they do/don't eq same I *should* be able to use that to reload or not, right?
Code: |
<script>
function sOnce() {
if (geocodeX != String(Request.Form("geocodeX")));
{
reload();
}
</script>
|
Basically the geocodeX value on the page will change via another function, but the form evaluation (in a hidden field) won't match until after submittal, so I need to resubmit the form after the first function is made. I s my syntax for my variables incorrect, because this did not work either...
PS, i have previously defined reload() as a submit form function. _________________ Beware the n00b...Hey, thats me! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|