Link to home
Start Free TrialLog in
Avatar of Poutrelle
Poutrelle

asked on

refresh a page without the annoying sound and progress bar

I need to refresh a page every 10 seconds (with dbase connection)
Now i've seen it done before that a page is refreshed without the annoying click sound, or the progress bar showing up at the bottom of the browser screen.
Anyone knows how this is done?
every 10 seconds, is that a good idea, i think refershing takes up resources and refreshing that much may put abit of a low your performace, you should check it out! Dont quote me on it but i seari have read that somewhere
>>>but i swear i have read that somewhere

that makes mroe sence
Avatar of Poutrelle

ASKER

well there is only 1 query executed so it hould not take that much bandwidth.
ASKER CERTIFIED SOLUTION
Avatar of frugle
frugle

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can give gve me more info on that hidden querying?
Add a meta refresh tag in the header section of the page that needs to be refreshed.

Following refreshes page called http://www.mysite.com/mypage.html every ten seconds. just replace the url with yours and put the tag between <head> and </head>

<META HTTP-EQUIV=Refresh CONTENT="10; URL=http://www.mysite.com/mypage.html">

For the click sound, see frugles answer...

Info on hidden querying would be another question, I'm afraid :)
owkee the meta tag i already had, also the sound it IE specific as feedback said.
The hidden query / refresh is something i need to look into

Thx fruggle and rest!
The way I've seen it done, and this isn't gospel by the way - there's bound to be more than one way to do it...

Using Javascript setInterval, load an image.

This "image" is actually a php script. If there are changes, send an image. If not, sleep()

You can then catch the image's onLoad event and trigger a page reload.

Have a play, and if you get it working, let me know!

Mike
This Code should work for you:

<script type="text/javascript">
<!--
function refresh()
{ location.href=this.location;}
//-->
window.setInterval('refresh()',120000);
</script>
If your page consists of data from your database and if you want to refresh the data on the page for any update, you can use XML and Javascript setInterval together. With javascript, you can check the database for every 10 secs. by loading xml document that you create by any server-side web language. Javascript will do its job in a "silent" way, and browser progress bar will show no action while checking database.
sorry guys... but having JS do a refresh is the same as having html do it...

you will still get the annoying IE click; or in firefox the cursor briefly changing to an hour glass (which isnt quite as bad as the click if you have your speakers on.