Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

internet explorer not refreshing .js file from script tag

38 views
Skip to first unread message

rob zand

unread,
Jul 26, 2002, 2:13:25 PM7/26/02
to
in an html file, i have <script src=...> tags in the head. these files
include arrays containing menu elements and corresponding urls. they
also have functions that process thru the arrays to display the menu
items. the function calls are located in <script>...</script> tags
within the html file and print headers, footers, left menus, around the
page content.

problem in internet explorer, it works fine in mozilla and ns 4.7:

if i reorder the array elements, add new arrays, etc, but do not make
any changes to the html file, ie is not reloading the script and
therefore not picking up the changes. it then errors allow over the
place because it can not find the function calls.

i tried fixing it by including "expires" and "no-cache" meta tags in the
html file but this failed; however, any change to the html file corrects
it. obviously the point was to be able to change the menus without
changing the content of the html so this is no good.

anyone know how to force ie to reload the .js file?

thanks.

Stephen

unread,
Jul 27, 2002, 12:23:11 AM7/27/02
to
Hi ...

Probably best to control this server-side. Too much browser
preference configuration can influence these behaviors to rely on
a client side solution.

The group FAQ addresses these issues at

http://jibbering.com/faq/#FAQ4_17

Especially, follow the link to
http://www.mnot.net/cache_docs/
for a discussion of "cache-control" type meta tags.


Regards,
Stephen

Stephen

unread,
Jul 27, 2002, 12:47:23 AM7/27/02
to
Hi, sorry for this.

I meant also to add:

By my observation, IE does NOT re-request files like .js (from
<script scr=xxx.js>) or .css (from <link rel=stylesheet ...>)
*within the same IE session* (that is, without exiting and
re-entering IE). Other files needed by a page -- image files, xml
files, etc. -- are re-requested (depending on browser preference
settings).

Maybe they're trying to do us a favor trying to save time. In my
opinion, this is incorrect and these files should be re-requested
from the server. If they were, the re-request could detect the
change and ship the changed files (depending on browser
preference settings).


Stephen

Jim Ley

unread,
Jul 27, 2002, 8:15:30 AM7/27/02
to
On Sat, 27 Jul 2002 04:47:23 GMT, Stephen <ssa...@austin.rr.com>
wrote:

>By my observation, IE does NOT re-request files like .js (from
><script scr=xxx.js>) or .css (from <link rel=stylesheet ...>)
>*within the same IE session* (that is, without exiting and
>re-entering IE). Other files needed by a page -- image files, xml
>files, etc. -- are re-requested (depending on browser preference
>settings).

I agree with this observation, if you make the js or css explicitly
uncacheable, IE doesn't cache them, but unlike with images which it
does IF_MODIFIED_SINCE requests on images which do not have explicit
cache information, whereas with js and css it's happy to just use the
last-modified date.

So if you want your js not to be cached, send "don't cache me headers"
on your js file.

If it's just a development issue, then a simple shift+refesh in IE
will do it.

Jim.

0 new messages