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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Onload to refresh page

Status
Not open for further replies.

lisalis99

Programmer
Jan 9, 2005
121
US
Hi,

Is there a function to refresh a page when it loads? I have data going into a database and until the user does an F5 will it show the new data.

Thanks,
Lisa
 
Have you tried using settime out in the onload and call a function that submits the form. thus reloading and refreshing the page, or even document.location.href , which can point to itself. or have you tried document.refresh()

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
I've tried:
<code>
function doLoad()
{
location.reload();
}
</script>
</code>

Then called it like this:
<code>
<body onLoad="doLoad();">
</code>

not working though-- any ideas???

Lisa

 
thought i used the code tags correctly, let's try again:

I've tried:
Code:
function doLoad()
{
   location.reload();
}
</script>

Then called it like this:
Code:
<body onLoad="doLoad();">

not working though-- any ideas???

Lisa
 
>Is there a function to refresh a page when it loads?
Just by thinking of it, is it a terrible thing to do?
 
Code:
function doLoad()
{
   location.reload();
}

Code:
<body onLoad="doLoad();">

Wouldn't that be an endless loop? Everytime the page loads it reloads?

[cheers]
~L.
 
>Wouldn't that be an endless loop? Everytime the page loads it reloads?
That's the point.
 
Why don't you just use a meta refresh tag?
Code:
<meta http-equiv="refresh" content="180; url=[i]your-page-url[/i]">
The 180 is the refresh time in seconds.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top