Connecting Tech Pros Worldwide Help | Site Map

Reload a html file in an IFrame

  #1  
Old December 6th, 2005, 10:55 AM
Chen Zhigao
Guest
 
Posts: n/a
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, 11:05 AM
Evertjan.
Guest
 
Posts: n/a

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, 11:15 AM
Chen Zhigao
Guest
 
Posts: n/a

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, 11:25 AM
Evertjan.
Guest
 
Posts: n/a

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, 06:35 PM
Dr John Stockton
Guest
 
Posts: n/a

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, 09:55 PM
Evertjan.
Guest
 
Posts: n/a

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)

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add OBJECT in DIV Asterbing answers 4 December 1st, 2005 12:55 AM
Generated file Andrew Clark answers 2 November 28th, 2005 03:15 PM
Changing HTML on the fly David answers 1 July 23rd, 2005 09:27 PM
IFRAME, view-source: for a page not loaded Pete Wason answers 5 July 20th, 2005 03:53 PM