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

refresh a page once when it loads

Status
Not open for further replies.

crmpicco

Programmer
Nov 29, 2004
66
GB
Hi All,

How can I refresh a page once when it loads, using JavaScript, VBScript or HTML.

Something like onload=window.refresh.

I know how to make it refresh every xSeconds. But I want it to refresh only once onLoad.

I tried the following to refresh the window once, Is it right?
<Body onLoad=window.refresh>

I know how to refresh it after an amount of time, like this
<META HTTP-EQUIV=" refresh" content=" 300;URL=
>

This will make it refresh every 5 minutes. I just want it to refresh once on load.

Thanks
 
I would send a querystring like this...
Code:
<script>
  function checkOnce(){
    qStr = Location.search
    if (qStr.indexOf("qqq") == -1){
      //page hasn't reloaded yet
      newQstr = qStr == "" ? "?qqq" : qStr + "&qStr=qqq"
      document.location = Location.href + newQstr
    }
  }
<script>
<body onLoad="checkOnce()">

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top