By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,818 Members | 2,089 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,818 IT Pros & Developers. It's quick & easy.

Problem with iframe (caching...)

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.