How to avoid public funtions in x.js to be cached by IE?

H

henrywuxg

Hi,

I got some problem with IE's cache. My question is: How to avoid
public funtions to be cached?

My case is:
In the header of the webpage a.html, it sourced the functions in
b.js.
<head>
<script src="b.js" language="javascript" type="text/javascript"></
script>

function c () {
// call funtion defined in b.js
}
</head>

The issue is: I have updated the function in b.js, but if I opened
a.html in IE, it still source the cached b.js so that the calling
function would be abnormal.

Do you have any idea to solve this?

Thanks

BR,
Henry
 
K

kindy

replace
<script src="b.js" language="javascript" type="text/javascript"></
script>
with
<script type="text/javascript">document.write('<s'+'cript
src="b.js?'+Math.random()+'" language="javascript" type="text/
javascript"></script>')</script>

it'll work in most time.
 
T

Thomas 'PointedEars' Lahn

kindy said:
replace
<script src="b.js" language="javascript" type="text/javascript"></
script>
with
<script type="text/javascript">document.write('<s'+'cript
src="b.js?'+Math.random()+'" language="javascript" type="text/
javascript"></script>')</script>

it'll work in most time.

It won't. And if you had cared to do some research before you posted,
you would have known that and why.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top