473,854 Members | 1,765 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 15949
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
4414
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
9899
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
9750
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11024
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...
1
10740
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10362
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
9510
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...
0
7076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4550
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
2
4149
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.