473,396 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.

Dec 6 '05 #1
5 5375
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

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

Dec 6 '05 #2
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?

Dec 6 '05 #3
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

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

Dec 6 '05 #4
JRS: In article <Xn********************@194.109.133.242>, dated Tue, 6
Dec 2005 10:51:48 local, seen in news:comp.lang.javascript, Evertjan.
<ex**************@interxnl.net> posted :

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.

--
© 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.
Dec 7 '05 #5
Dr John Stockton wrote on 07 dec 2005 in comp.lang.javascript:
JRS: In article <Xn********************@194.109.133.242>, dated Tue, 6
Dec 2005 10:51:48 local, seen in news:comp.lang.javascript, Evertjan.
<ex**************@interxnl.net> posted :

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


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?

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

Dec 7 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bb | last post by:
I am trying to force an iframe to refresh from the server using the following javascript: document.frames("frm").document.location.reload(true) The iframe html is: <iframe id="frm" name="frm"...
3
by: Alexandre Jaquet | last post by:
Hi I wanna know how can I reload an iframe does I've to move my iframe into another form an do a submit or may I can do it by another way rigth now I'm been doing : my form name is mainform...
18
by: Alan Z. Scharf | last post by:
1. I have a chain of six asynch callbacks initiated by a button, and want the page to refresh at the end of each callback to display A. Results of a SQLServer query showing cumulative running...
7
by: fh | last post by:
hello! I 've a found way to reload my page automatically every n seconde using this code Response.AppendHeader("Refresh", "4"); it works fine but I wish to do the same with only a part of my...
0
by: spolsky | last post by:
hi, i have the following pages. when form submitted with the field1 value is "ok" then the iframe must be loaded with the text "Page loaded...". This works fine with IE 6 and FireFox(1.5) but...
1
by: Me | last post by:
Hello, The code below runs well on IE 6 and 7. On Firefox it loads the first time but throws the following error on reloads. Error: top is not defined Source File: top.myIFrameBody();...
7
by: Raffi | last post by:
I'm facing a tricky (at least for me) page reload/refresh scenario and need some help. I'm working on a web application which is primarily used with MSIE. The application has a main window with...
2
by: ericisjusteric | last post by:
I have a page with multiple iframes and need to have the user (ie6) be able to click a button to refresh any one of the iframes - but also to click another button at the top of the page to refresh...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.