...

View Full Version : refreshing help



shade0o
05-01-2008, 05:47 PM
hey,
how do i get get a script to target a iframe and refresh it after X amount of seconds.

i found some code to make page refresh but am adding another iframe and dont want this one to refresh also.

both targets are external and i havn't use HTML since school (a good 4 years ago) and never learnt JS at all.


<script>
<!--
var limit="0:10"

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>

also wondering if i need the following code if i remove the minutes from the var timer

var limit="0:10"

if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
into just

var limit="10"

thanks in advance

JoWiGo
05-01-2008, 06:00 PM
I don't think that the code that you recieved was meant for what you are looking at doing. Now I'm not going to berate you for using iframes (comeon man... really? iframes?) but I found a solution with a quick Google search (refresh an iframe).

Simply put this line of javascript somewhere that it will be read and you should be good to go. Replace 'myinnerframe' with the name of your frame. The 1000 is the time in miliseconds until the reloading (currently at 10 seconds).


window.setTimeout("self.frames.myInnerFrame.location.reload(true)", 10000);

I have not tested this code, let me know if it works.

shade0o
05-01-2008, 06:34 PM
its doesn't seem to be working but thanks anyways.

and im just writing up a small page to stop the auto logout from being idle.
so for the 10people who are going to see it it wont matter what it looks like so the frames are no worry.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum