Refresh Button

similar thing in JavaScript????

Page 1 of 1

2 Replies - 9902 Views - Last Post: 28 September 2002 - 01:10 PM

#1 Koenie  Icon User is offline

  • What?!

Reputation: 0
  • View blog
  • Posts: 1,313
  • Joined: 08-July 02

Refresh Button

Posted 28 September 2002 - 01:04 PM

Is there any thing that can do the same thing like the Refresh button in the browser window in Javascript?????

Thanks, Koenie
Is This A Good Question/Topic? 0
  • +

Replies To: Refresh Button

#2 Quik  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2
  • View blog
  • Posts: 3,750
  • Joined: 06-March 01

Re: Refresh Button

Posted 28 September 2002 - 01:07 PM

<html>

<head>
<title>Refresh Javascript Example</title>
<noscript>
<!--
We have the "refresh" meta-tag in case the user's browser does
not correctly support Javascript or has Javascript disabled.

Notice that this is nested within a "noscript" block.
-->
<meta http-equiv="refresh" content="2">

</noscript>

<script language="Javascript">
<!--

var sURL = unescape(window.location.pathname);

function doLoad()
{
// the timeout value should be the same as in the "refresh" meta-tag
setTimeout( "refresh()", 2*1000 );
}

function refresh()
{
// This version of the refresh function will cause a new
// entry in the visitor's history. It is provided for
// those browsers that only support Javascript 1.0.
//
window.location.href = sURL;
}
//-->
</script>

<script language="Javascript1.1">
<!--
function refresh()
{
// This version does NOT cause an entry in the browser's
// page view history. Most browsers will always retrieve
// the document from the web-server whether it is already
// in the browsers page-cache or not.
//
window.location.replace( sURL );
}
//-->
</script>

<script language="Javascript1.2">
<!--
function refresh()
{
// This version of the refresh function will be invoked
// for browsers that support Javascript version 1.2
//

// The argument to the location.reload function determines
// if the browser should retrieve the document from the
// web-server. In our example all we need to do is cause
// the Javascript block in the document body to be
// re-evaluated. If we needed to pull the document from
// the web-server again (such as where the document contents
// change dynamically) we would pass the argument as 'true'.
//
window.location.reload( false );
}
//-->
</script>
</head>

<!--
Use the "onload" event to start the refresh process.
-->
<body onload="doLoad()">

<script language="Javascript">
<!--
// we put this here so we can see something change
document.write('<b>' + (new Date).toLocaleString() + '</b>');
//-->
</script>


</body>

</html>


MESS with that..it includes a DATE feature but u can remove it
Was This Post Helpful? 0
  • +
  • -

#3 Koenie  Icon User is offline

  • What?!

Reputation: 0
  • View blog
  • Posts: 1,313
  • Joined: 08-July 02

Re: Refresh Button

Posted 28 September 2002 - 01:10 PM

Thanx, I'll work that out.

Koenie
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1