Current location: Hot Scripts Forums » General Web Coding » JavaScript » Auto Refreshing an external framed page...


Auto Refreshing an external framed page...

Reply
  #1 (permalink)  
Old 07-05-05, 11:37 AM
onlineworks onlineworks is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Question Auto Refreshing an external framed page...

Greetings.
I have a frameset that loads two external page.
I want to know is there anyway that I auto refresh just one of external pages each 45 seconds from my frameset ?
For example "header" and "main" are the two external pages and I just want to auto refresh the "main" ...
And also here is another problem ...
I have sent a variable to that page , for example:
<frame name="main" src="http://www.externalsite.com/main.php?ss=test">

I want the main.php always be refreshed with this variable(ss=test).
Help please...
Reply With Quote
  #2 (permalink)  
Old 07-05-05, 03:09 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
use the setTimeout() function.

I haven't tested this, just wrote it out as is... if it doesn't work it should give you a good idea as to what you should be doing, or maybe someone with a bit more time on their hands could fix any errors:
Code:
<html>
<head>
<title></title>

<script type="text/javascript">
<!--

setTimeout('refresh()', 45000);

function refresh() {
window.frames['main'].location.href = 'http://www.externalsite.com/main.php?ss=test';
setTimeout('refresh()', 45000);
}
//-->
</script>

</head>

<frameset rows="150,*">

<frame name="top" src="http://www.externalsite.com/top.php" SCROLLING="no" noresize marginheight="0" marginwidth="0" />
<frame name="main" src="http://www.externalsite.com/main.php?ss=test" SCROLLING="no" />

</frameset>

</html>

Last edited by Keith; 07-05-05 at 03:29 PM.
Reply With Quote
  #3 (permalink)  
Old 07-05-05, 07:23 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
I just got a moment to test it and it should work fine for you.

The 45000 is milliseconds, so 45000 is equivalent to 45 seconds.
Reply With Quote
  #4 (permalink)  
Old 07-06-05, 05:48 PM
onlineworks onlineworks is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

Thanks a lot , It works great ...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
My page does not hold together after Refreshing deastro HTML/XHTML/XML 2 07-27-04 05:05 PM
refreshing external js file fs22 JavaScript 2 06-17-04 11:23 PM
page browsing problem mivec PHP 3 04-17-04 03:43 AM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM


All times are GMT -5. The time now is 10:49 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.