Hello All,
I have a question regarding caching with javascript.
Traditionally, banner dispayed on webpages are done so by using a timestamp or random number either clientside using javascript or serverside. This ensures a revisit to a page forces a new banner to be called rather than using a cached version.
In a particular situation, we are using javascript to initially invoke this process using math.random() (it is also done serverside but the clientside version seems to be causing a problem).
If a page with banner code (shown below) is viewed, a link (not the banner) on the page is clicked and then the user views the new page before hitting the back button and returning to the original page, will the javascript shown be re-run or will the browser use a cached version and thus use a cached banner?
<SCRIPT language=JavaScript type=text/javascript>
<!--
var rnd = Math.round(Math.random() * 10000000);
document.writeln('<IFRAME src=" width=468 height=60 scrolling=no allowtransparency=true frameborder=0 marginheight=0 marginwidth=0>\n');
document.writeln('<A href=" target="_blank">\n');
document.writeln('<IMG src=" width=468 height=60 border=0 ismap></A></IFRAME>\n');
//-->
</SCRIPT>
I have been given the explanation below which I am not sure is correct.
" While you're navigating through the site and go back via the back-button (it
is important to go back with the back-button, as it will reload the page
from the cache), the Iframe won't be requested.
This must be a IE bug."
If is the comment about the iFrame not being requested true, and if so will any of the javascript been called /invocoated?
Thanks all,
Dan
Dan Morgan - Sitepoint Mentor (Glenplake)
(20,000+ member webmaster forums)
(Webmaster resources)
I have a question regarding caching with javascript.
Traditionally, banner dispayed on webpages are done so by using a timestamp or random number either clientside using javascript or serverside. This ensures a revisit to a page forces a new banner to be called rather than using a cached version.
In a particular situation, we are using javascript to initially invoke this process using math.random() (it is also done serverside but the clientside version seems to be causing a problem).
If a page with banner code (shown below) is viewed, a link (not the banner) on the page is clicked and then the user views the new page before hitting the back button and returning to the original page, will the javascript shown be re-run or will the browser use a cached version and thus use a cached banner?
<SCRIPT language=JavaScript type=text/javascript>
<!--
var rnd = Math.round(Math.random() * 10000000);
document.writeln('<IFRAME src=" width=468 height=60 scrolling=no allowtransparency=true frameborder=0 marginheight=0 marginwidth=0>\n');
document.writeln('<A href=" target="_blank">\n');
document.writeln('<IMG src=" width=468 height=60 border=0 ismap></A></IFRAME>\n');
//-->
</SCRIPT>
I have been given the explanation below which I am not sure is correct.
" While you're navigating through the site and go back via the back-button (it
is important to go back with the back-button, as it will reload the page
from the cache), the Iframe won't be requested.
This must be a IE bug."
If is the comment about the iFrame not being requested true, and if so will any of the javascript been called /invocoated?
Thanks all,
Dan
Dan Morgan - Sitepoint Mentor (Glenplake)
(20,000+ member webmaster forums)
(Webmaster resources)