473,386 Members | 1,738 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,386 software developers and data experts.

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.peroli?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("myscript.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.getElementById('rGen');
rGen.style.display = '';
frames['rGen'].location.href="myscript.peroli";
}
[/script]
//----------------------------------------------------

regards,
Peroli Sivaprakasam

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

bla.href = "mypage.html?randomrequest=" + random number
"Peroli" <pe****@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.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.peroli?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("myscript.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.getElementById('rGen');
rGen.style.display = '';
frames['rGen'].location.href="myscript.peroli";
}
[/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?randomrequest=" + random number


I personally suggest

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

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

"Christopher Benson-Manica" <at***@nospam.cyberspace.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?randomrequest=" + random number


I personally suggest

bla.href="mypage.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.peroli?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("myscript.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.getElementById('rGen');
rGen.style.display = '';
frames['rGen'].location.href="myscript.peroli";
}
[/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
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 += "=" +...
29
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...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.