Reload a html file in an IFrame

C

Chen Zhigao

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.
 
E

Evertjan.

Chen Zhigao wrote on 06 dec 2005 in comp.lang.javascript:
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.


Make the url different each reload, something like:

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

Chen Zhigao

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?
 
E

Evertjan.

Chen Zhigao wrote on 06 dec 2005 in comp.lang.javascript:
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?

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
 
D

Dr John Stockton

JRS: In article <[email protected]>, dated Tue, 6
Dec 2005 10:51:48 local, seen in Evertjan.
Make the url different each reload, something like:

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

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.
 
E

Evertjan.

Dr John Stockton wrote on 07 dec 2005 in comp.lang.javascript:
JRS: In article <[email protected]>, dated Tue, 6
Dec 2005 10:51:48 local, seen in Evertjan.


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

good idea

or:

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

or just

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

in which the last space is necessary.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top