473,804 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with iframe (caching...)

Hi all,
I have an iframe as stated below. When i initiate the function
"open_frm() " everything is working as i expected.

When the document is loaded, i click on a link in the iframe, with
posts some data to the server (to url "myscript.perol i?q=something")
and gets back with results. Everything happens inside the iframe, no
interaction with parent window.

But when i do this 2 or more times, mozilla and IE is giving me a
cached copy. But if i reload the iframe (by right clicking on iframe
and reload) again after initiating the function it gets the right stuff
from the server.

I even accessed the script("myscrip t.peroli") in a new window, it
gave me the right result. Its just that when its loaded into iframe, it
gives cached copy.

I tried setting cache-control pragmas and meta directives and
forced the browser not to cache the data, but they seem to ignore them
particularly when inside IFRAME.

Is this a bug or am i doing something wrong? If you know of any
workarounds... let me know.

[html]
<iframe id="rGen" name="rGen" width="95%" height="400"
style="display: none" frameborder="0" >Your Browser doesn't support
Iframes</iframe>
[/html]
//---------------------------------------------------
[script]
function open_frm() {
if(typeof frames['rGen'] == 'undefined') return;
var rGen = document.getEle mentById('rGen' );
rGen.style.disp lay = '';
frames['rGen'].location.href= "myscript.perol i";
}
[/script]
//----------------------------------------------------

regards,
Peroli Sivaprakasam

Sep 19 '05 #1
5 15948
add a random parameter to the request of the page

bla.href = "mypage.html?ra ndomrequest=" + random number
"Peroli" <pe****@gmail.c om> wrote in message
news:11******** *************@g 44g2000cwa.goog legroups.com...
Hi all,
I have an iframe as stated below. When i initiate the function
"open_frm() " everything is working as i expected.

When the document is loaded, i click on a link in the iframe, with
posts some data to the server (to url "myscript.perol i?q=something")
and gets back with results. Everything happens inside the iframe, no
interaction with parent window.

But when i do this 2 or more times, mozilla and IE is giving me a
cached copy. But if i reload the iframe (by right clicking on iframe
and reload) again after initiating the function it gets the right stuff
from the server.

I even accessed the script("myscrip t.peroli") in a new window, it
gave me the right result. Its just that when its loaded into iframe, it
gives cached copy.

I tried setting cache-control pragmas and meta directives and
forced the browser not to cache the data, but they seem to ignore them
particularly when inside IFRAME.

Is this a bug or am i doing something wrong? If you know of any
workarounds... let me know.

[html]
<iframe id="rGen" name="rGen" width="95%" height="400"
style="display: none" frameborder="0" >Your Browser doesn't support
Iframes</iframe>
[/html]
//---------------------------------------------------
[script]
function open_frm() {
if(typeof frames['rGen'] == 'undefined') return;
var rGen = document.getEle mentById('rGen' );
rGen.style.disp lay = '';
frames['rGen'].location.href= "myscript.perol i";
}
[/script]
//----------------------------------------------------

regards,
Peroli Sivaprakasam

Sep 19 '05 #2
Zoe Brown <zo***********@ n-o-s-p-a-a-mtesco.net> wrote:
add a random parameter to the request of the page bla.href = "mypage.html?ra ndomrequest=" + random number


I personally suggest

bla.href="mypag e.html?junk="+( new Date()).valueOf ());

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Sep 19 '05 #3

"Christophe r Benson-Manica" <at***@nospam.c yberspace.org> wrote in message
news:dg******** **@chessie.cirr .com...
Zoe Brown <zo***********@ n-o-s-p-a-a-mtesco.net> wrote:
add a random parameter to the request of the page

bla.href = "mypage.html?ra ndomrequest=" + random number


I personally suggest

bla.href="mypag e.html?junk="+( new Date()).valueOf ());


that would do it !!
Sep 19 '05 #4
Hi Peroli

You need to pass a unique parama each time you want to "force" the page
to readload.

I have made a example and explained in greater depth here :
http://km0ti0n.blunted.co.uk/viewng....27725749843750

hope it helps

Peroli wrote:
Hi all,
I have an iframe as stated below. When i initiate the function
"open_frm() " everything is working as i expected.

When the document is loaded, i click on a link in the iframe, with
posts some data to the server (to url "myscript.perol i?q=something")
and gets back with results. Everything happens inside the iframe, no
interaction with parent window.

But when i do this 2 or more times, mozilla and IE is giving me a
cached copy. But if i reload the iframe (by right clicking on iframe
and reload) again after initiating the function it gets the right stuff
from the server.

I even accessed the script("myscrip t.peroli") in a new window, it
gave me the right result. Its just that when its loaded into iframe, it
gives cached copy.

I tried setting cache-control pragmas and meta directives and
forced the browser not to cache the data, but they seem to ignore them
particularly when inside IFRAME.

Is this a bug or am i doing something wrong? If you know of any
workarounds... let me know.

[html]
<iframe id="rGen" name="rGen" width="95%" height="400"
style="display: none" frameborder="0" >Your Browser doesn't support
Iframes</iframe>
[/html]
//---------------------------------------------------
[script]
function open_frm() {
if(typeof frames['rGen'] == 'undefined') return;
var rGen = document.getEle mentById('rGen' );
rGen.style.disp lay = '';
frames['rGen'].location.href= "myscript.perol i";
}
[/script]
//----------------------------------------------------

regards,
Peroli Sivaprakasam


Sep 19 '05 #5
Hi Km0ti0n and everyone else,
km0ti0n wrote:
Hi Peroli

You need to pass a unique parama each time you want to "force" the page
to readload.

I have made a example and explained in greater depth here :
http://km0ti0n.blunted.co.uk/viewng....27725749843750

hope it helps


Thanks a lot. It worked. I feel so silly that i didn't know this.

-- Peroli Sivaprakasam

Sep 20 '05 #6

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

Similar topics

2
1062
by: hth | last post by:
Hi I usually check the key and value in my cache with following code: foreach (DictionaryEntry objItem in Cache) { lblCache.Text += "<li>" + objItem.Key; lblCache.Text += "=" + objItem.Value.ToString(); }
29
4409
by: Vjay77 | last post by:
I have a timer which triggers AxWebBrowser1 every 5 minutes to visit one of my websites. What I find out later in my websites logs, was, that it really visited my website only for the first time. Second time it went to the site and every other time, it was reloaded probably from the cache, hdd or from somewhere... I am just guessing.
1
4506
by: k.roemke | last post by:
Hello! After a longer time I want to do some javascript again. Task: set content of an iframe to the origin page if the mouse is not moved Problem: <iframe onmousemove="resetCounter();return true;" does not work as expected.
0
9712
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10595
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.