Reload a html file in an IFrame 
December 6th, 2005, 10:55 AM
| | | |
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. | 
December 6th, 2005, 11:05 AM
| | | | 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) | 
December 6th, 2005, 11:15 AM
| | | | 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? | 
December 6th, 2005, 11:25 AM
| | | | 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) | 
December 7th, 2005, 06:35 PM
| | | | 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. | 
December 7th, 2005, 09:55 PM
| | | | 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) |  | | | | /bytes/about
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 225,689 network members.
|