Connecting Tech Pros Worldwide Help | Site Map

Reload a html file in an IFrame

 
LinkBack Thread Tools Search this Thread
  #1  
Old December 6th, 2005, 09:55 AM
Chen Zhigao
Guest
 
Posts: n/a
Default Reload a html file in an IFrame

My main html page contains an IFrame in which another html page is
shown. The main page can trigger my CGI program to re-generate the
IFrame html page with quite some data from a database. However, the
content shown in the IFrame does not refreshed sometimes unless I click
the browser refresh button.

I even use

parent.navigate('/cgi-bin/mycgi?inputname=inputvalue')
window.location.reload(true)

in the IFrame page to force refreshing. But it seems only main page is
up to date whereas the IFrame page isn't.

How shall I accomplish this? Any advice is appreciated.


  #2  
Old December 6th, 2005, 10:05 AM
Evertjan.
Guest
 
Posts: n/a
Default Re: Reload a html file in an IFrame

Chen Zhigao wrote on 06 dec 2005 in comp.lang.javascript:
[color=blue]
> My main html page contains an IFrame in which another html page is
> shown. The main page can trigger my CGI program to re-generate the
> IFrame html page with quite some data from a database. However, the
> content shown in the IFrame does not refreshed sometimes unless I click
> the browser refresh button.
>
> I even use
>
> parent.navigate('/cgi-bin/mycgi?inputname=inputvalue')
> window.location.reload(true)
>
> in the IFrame page to force refreshing. But it seems only main page is
> up to date whereas the IFrame page isn't.
>
> How shall I accomplish this? Any advice is appreciated.[/color]


Make the url different each reload, something like:

var dummy=new Date()
myIfame.location.href='/cgi-bin/mycgi?inputname=inputvalue&dummy='+dummy

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

  #3  
Old December 6th, 2005, 10:15 AM
Chen Zhigao
Guest
 
Posts: n/a
Default Re: Reload a html file in an IFrame

Thanks for your prompt reply. The URL of
'/cgi-bin/mycgi?inputname=inputvalue' is for the main page, and the
"inputvalue" actually varies each time the CGI is invoked. But the URL
of the regenerated IFrame page does not change as I use the same file
name. Any other thought?

  #4  
Old December 6th, 2005, 10:25 AM
Evertjan.
Guest
 
Posts: n/a
Default Re: Reload a html file in an IFrame

Chen Zhigao wrote on 06 dec 2005 in comp.lang.javascript:
[color=blue]
> Thanks for your prompt reply. The URL of
> '/cgi-bin/mycgi?inputname=inputvalue' is for the main page, and the
> "inputvalue" actually varies each time the CGI is invoked. But the URL
> of the regenerated IFrame page does not change as I use the same file
> name. Any other thought?
>[/color]

No, please try my example on the pagename [you did not mention]:

'/zzz/mypageIframe.html?dummyvalue='+aChangingVariable

where aChangingVariable can contain a random value or a time value

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

  #5  
Old December 7th, 2005, 05:35 PM
Dr John Stockton
Guest
 
Posts: n/a
Default Re: Reload a html file in an IFrame

JRS: In article <Xns972478AF4E461eejj99@194.109.133.242>, dated Tue, 6
Dec 2005 10:51:48 local, seen in news:comp.lang.javascript, Evertjan.
<exjxw.hannivoort@interxnl.net> posted :[color=blue]
>
>Make the url different each reload, something like:
>
>var dummy=new Date()
>myIfame.location.href='/cgi-bin/mycgi?inputname=inputvalue&dummy='+dummy[/color]

That might work, or it might work only once per day; I'd suggest

var dummy = +new Date()
myIfame.location.href='/cgi-bin/mycgi?inputname=inputvalue&dummy='+dummy

or just

.... = '/cgi-bin/mycgi?inputname=inputvalue&dummy='+ +new Date()

in which the last space is necessary.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
  #6  
Old December 7th, 2005, 08:55 PM
Evertjan.
Guest
 
Posts: n/a
Default Re: Reload a html file in an IFrame

Dr John Stockton wrote on 07 dec 2005 in comp.lang.javascript:
[color=blue]
> JRS: In article <Xns972478AF4E461eejj99@194.109.133.242>, dated Tue, 6
> Dec 2005 10:51:48 local, seen in news:comp.lang.javascript, Evertjan.
> <exjxw.hannivoort@interxnl.net> posted :[color=green]
>>
>>Make the url different each reload, something like:
>>
>>var dummy=new Date()
>>myIfame.location.href='/cgi-bin/mycgi?inputname=inputvalue&dummy='+dummy[/color]
>
> That might work, or it might work only once per day; I'd suggest
>
> var dummy = +new Date()
> myIfame.location.href='/cgi-bin/mycgi?inputname=inputvalue&dummy='+dummy
>[/color]

good idea

or:

myIfame.location.href=
'/cgi-bin/mycgi?inputname=inputvalue&MadRandom='+Math.random ()

[color=blue]
> or just
>
> ... = '/cgi-bin/mycgi?inputname=inputvalue&dummy='+ +new Date()
>
> in which the last space is necessary.[/color]

Second space from the right too.
You did mean that one, I presume?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.