Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

use javascript to enter ctrl-shift refresh for inframe page

Posted on 2009-07-11
4
Medium Priority
?
231 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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

963 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