Solved

use javascript to enter ctrl-shift refresh for inframe page

Posted on 2009-07-11
4
219 Views
Last Modified: 2012-08-13
I am having the nasty IE unwanted caching of javascript, and had to use ctrl-shift refresh to refresh some js on a page.

worse yet, it is an iframe page, so I had to use refresh in the context menu,

anyone know of a way to do this with javascript instead?
0
Comment
Question by:bhomass
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
Xemorph earned 250 total points
ID: 24833479
You can append a random string onto the javascript file.  For example, append the current timestamp...

<script src="scripts/script.js?34325234534" type="text/javascript" ></script>

To try to get IE to reload it everytime
0
 
LVL 15

Expert Comment

by:fsze88
ID: 24834294
you can try add
<meta http-equiv="Pragma" content="no-cache">
between <head></head> tag
0
 

Author Comment

by:bhomass
ID: 24836518
I already tried the whole set of header settings

            resp.setHeader("Cache-Control", "no-store, no-cache, must-revalidate");
            resp.setHeader("Pragma","no-cache"); //HTTP 1.0
            resp.setDateHeader("Expires", 0); //prevents caching at the proxy server

none worked. not a surprise. this non-response has been reported by others.

if no other shows up, it will have to be the uniquer url approach with random number on the tail.
0
 
LVL 4

Expert Comment

by:Xemorph
ID: 24911721
Did the random string help you?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now