Member Panel


Sponsors and Ads

Live Tag Cloud

PC Forum PC Help Forum » Web & Networking » Web Design » Javascript veery simple problem

Web Design - Javascript veery simple problem posted in the Web & Networking forums; All I want is a very small script that will reload the entire page after 2 seconds, what I have is this but it does nothing. <script language="Javascript1.2"> function reload() ...

JOIN US NOW to remove these Ads

pc help forum number one in the search engines
Post New Thread  Reply
  #1  
Old 08-30-2006
Ge64's Avatar
P C H F R 0 0 l Z
 
Join Date: Oct 2005
Location: Hong Kong
Posts: 232
PC Experience: Good at least
Ge64 - See this Members User comments on their Profile page
Send a message via MSN to Ge64
Default Javascript veery simple problem

All I want is a very small script that will reload the entire page after 2 seconds, what I have is this but it does nothing.

<script language="Javascript1.2">
function reload()
{
window.location.replace ("/index.php?page=news");
}

setTimeout("refresh()", 2*1000 );
</script>


__________________
PCHF RoX ur SoX
:computer1
PC SmAsH0R
  #2  
Old 08-30-2006
Hengis's Avatar
PCHF Founder & Owner
My PC
 
Join Date: Jan 2004
Location: Newbury, England
Posts: 10,790
PC Experience: Always learning
Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page Hengis - See this Members User comments on their Profile page
Send a message via Skype™ to Hengis
Default

I've used this one before and it comes with a timer (goes into the <head>):

Code:
<script>
<!--

/*
Auto Refresh Page with Time script
By JavaScript Kit (javascriptkit.com)
Over 200+ free scripts here!
*/

//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="0:30"

if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{ 
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
else
curtime=cursec+" seconds left until page refresh!"
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}

window.onload=beginrefresh
//-->
</script>


__________________
> Pre-Work > System File Checker
> Did we help you? If we did, please consider Donating

Reply
New! Norton Internet Security 2008 – Download Now Click Here

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On


All times are GMT +1. The time now is 12:41 PM.
Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC7
All Graphics & Content Copyright © 2004-2008 - PC Help Forum.com


Back to Top