473,396 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Refreshing .js files

I've got the usual suspects on KDE: Firefox, Konqueror and Opera. All
aggressively cache .js files. I've not figured out a way to remove a
cached .js without closing the browser and restarting it.

This makes them useless while coding .js files. My solution (kludge?)
is to leave what will become .js between <script</scripttags in
the HTML until it feels like it is fully-featured and totally debugged
and then move it into a .js. As "fullly-featured and totally debugged"
is a rare condition, I've got more JavaScript in HTML than in .js,
where it belongs.

Is there a better way? A browser smart enough to compare time stamps
and reload .js as necessary?
Aug 24 '08 #1
5 1259
Ma************@gmail.com wrote:
Is there a better way? A browser smart enough to compare time stamps
and reload .js as necessary?
Why not
<script src="something.js?x='+(Math.random())' ...
?
Aug 24 '08 #2
Ma************@gmail.com meinte:
I've got the usual suspects on KDE: Firefox, Konqueror and Opera. All
aggressively cache .js files. I've not figured out a way to remove a
cached .js without closing the browser and restarting it.
Each browser comes with help files.

Ctrl-F5 does the job for me at least in FF. IIRC F5 skips the cache in
Opera, too.
Or "Disable->Cache" with the web developer extension.
Or clear the cache in the preferences dialog.
Or...

Gregor

--
http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
http://web.gregorkofler.com ::: meine JS-Spielwiese
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Aug 24 '08 #3
Ma************@gmail.com writes:
I've got the usual suspects on KDE: Firefox, Konqueror and Opera. All
aggressively cache .js files. I've not figured out a way to remove a
cached .js without closing the browser and restarting it.

This makes them useless while coding .js files. My solution (kludge?)
is to leave what will become .js between <script</scripttags in
the HTML until it feels like it is fully-featured and totally debugged
and then move it into a .js. As "fullly-featured and totally debugged"
is a rare condition, I've got more JavaScript in HTML than in .js,
where it belongs.

Is there a better way? A browser smart enough to compare time stamps
and reload .js as necessary?
Firefox, at least, will refresh all files when reloading using
SHIFT+CTRL+R and SHIFT-F5. I also suspect (but I haven't tested this
explicitly) that setting some aggressive non-caching headers should
make refreshing work on recent versions of all these browsers. And you
probably should do that during development anyway.

http://www.w3.org/Protocols/rfc2616/...4.html#sec14.9

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Aug 24 '08 #4
In comp.lang.javascript message <a7a73088-8603-4ead-aeab-a754394dea21@k7
g2000hsd.googlegroups.com>, Sun, 24 Aug 2008 10:15:24,
Ma************@gmail.com posted:
>I've got the usual suspects on KDE: Firefox, Konqueror and Opera. All
aggressively cache .js files. I've not figured out a way to remove a
cached .js without closing the browser and restarting it.

This makes them useless while coding .js files. My solution (kludge?)
is to leave what will become .js between <script</scripttags in
the HTML until it feels like it is fully-featured and totally debugged
and then move it into a .js. As "fullly-featured and totally debugged"
is a rare condition, I've got more JavaScript in HTML than in .js,
where it belongs.

Is there a better way? A browser smart enough to compare time stamps
and reload .js as necessary?
Try writing the '<script type="text/javascript" src="...js"></script>'
with 'document.writeln', but appending to "...js" '+ +new Date()'. That
might defeat the caching.

Or write a utility to rename the ...js file and change the reference to
it correspondingly.

I assume you've tried shift-reload or similar?

Or run a Windows emulator with a Windows browser in it.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQqish topics, acronyms & links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
Aug 24 '08 #5
Thanks, all, for the suggestions. Reading them I went back to Windows
where I learned the FF Windows is NOT FF KDE. Didn't take much
fiddling to get FF Win to reload. FF KDE has not yielded to fiddling.
Looks like a utility to rename the .js and edit the new name into the
HTML is called for. (I really DON'T want to return to a single-desktop
OS.)
Aug 26 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jamie Jackson | last post by:
The crux of the problem is I only know if the popup *has been* opened, but not if it *is* open. Therefore, the script doesn't know whether to simply refocus, or whether to popup a fresh window. ...
60
by: A.Translator | last post by:
I have been struggling with a page that is based on a table structure (because that is all I am feeling comfortable with at the moment) styled with css. One of the problems I run in to is Opera...
5
by: Scott Tilton | last post by:
I am having a terrible time getting this to work. I am hoping someone out there can help me with very specific code examples. I am trying to get the linked tables in my Access 97 database to be...
5
by: John | last post by:
I have an application that scans files and it takes a while to finish. While my application is running if I open other applications, my main application GUI becomes grey....does not refresh or...
5
by: Jensen Bredal | last post by:
Hello, I need to display self refreshing information on a web page written with asp.net. I would image that the info would be displayed either as part of a user control or a web control. How can...
0
by: sean.hpr | last post by:
Hi all- I am a vb2005 newb so apologies in advance. Essentially I am having some problems with data refreshing on some of my forms. Background: I have created a project containing a few...
13
by: honey99 | last post by:
Hi! I have to fix a problem in JSP.Actually,i have a JSP page say Ex1.jsp.In this Ex1.jsp i have an anchor tag which links into another JSP page i.e when i click on the link another pop-up window...
3
polymorphic
by: polymorphic | last post by:
I have succeeded in embedding PDF files in a dynamic iframe. The problem is that I need the PDF to cache. If the PDF remains the same from page load to page load then the pdf is somehow cached with...
1
by: Salad | last post by:
If one distributes a front/backend app is there a good practice for refreshing the links? I was thinking that the first time the user enters the app, it could check for any tables. If the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.