Processing
 

Browser does not show changes in JavaScript. It keeps the old version

28/10/2013 21:42#1

Davo

Member

Joined at: 10 months ago

Post: 3

Thank: 0

Thanked: 0

Im working with:

  • Chrome

  • Codegnitor (PHP)

  • XAMPP

  • CSS and JS

My problem is: When I do a small change in CSS or JS (any simple, trivial change), the browser does not show this change. Only when I rename the CSS or JS file it shows the change.

Its looks like the browser remembers the old version of CSS or JS and does not "go and look for the changes" when I reload the page in Chrome.

Any idea what is holding back the browser?

I've been searching for a question, but found only people whose browsers do not take jS into consideration at all.

But my browser does. It deos load JS, but not the changes that I make.

The funny thing is that a week ago I needed to rename CSS and JS file once or twice a day, but now I need to rename it when I make any change to see that change displayed in the browser.

So it is imposible to work.

Someone having the same issue?

P.S. I'm having the same issue with Mozilla nad IE. So I guess somthing could be wrong with my computer. Could it be one of those security programs. I've got one with FileZilla two weeks ago but I thought I've got rid of it. Maybe it is still making the mess in the background.

28/10/2013 21:46Top#2

amosmos

Member

Joined at: 10 months ago

Post: 3

Thank: 0

Thanked: 0

The CSS and js resources are probably cached by your browser.

When you change and reload to test, try reloading using Ctrl+R to refresh the cache in that reload. This should work with all browsers.

28/10/2013 21:48Top#3

sUP

Member

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

You can disable cache when developer tools is visible. Hit F12 and click the little gear at the bottom right. In "General" make sure that the first box "Disable cache (while DevTools is open)" is ticked and you're good to go

23/06/2016 00:14Top#4

Adam

Member

Joined at: 10 months ago

Post: 319

Thank: 0

Thanked: 0

Just in case other people come across this you can add a get variable to the file name like src="js/custom.js?version=1" then it will recheck if it doesnt know. You could have all the custom javascript and css files like this and with php use something like:

src="js/custom.js?version=<?php echo $version; ?>" 

then justupdate $version in one place anytime you make a change. This will also guarantee users see the change as well.

Similar articles

Chrome, THREE.js: Cross-origin image load denied

5 years ago - Reply: 5 - Views: 267

Prevent Google Chrome Log XMLHttpRequest

3 years ago - Reply: 5 - Views: 276

How can I include ChromeDriver in a JAR?

3 years ago - Reply: 3 - Views: 80

Chrome geolocation not working on any site

3 years ago - Reply: 1 - Views: 43

wrong borders' width in android browser

3 years ago - Reply: 4 - Views: 205

Uncaught SyntaxError: Unexpected token < On Chrome

3 years ago - Reply: 10 - Views: 462

Flashdata not getting cleared in Codeigniter

3 years ago - Reply: 5 - Views: 57

Illegal access Javascript error in Chrome

3 years ago - Reply: 1 - Views: 51

ng-repeat not updating in Chrome

3 years ago - Reply: 1 - Views: 81

Applying border to a checkbox in Chrome

4 years ago - Reply: 2 - Views: 118

open browser plugin using access vba

3 years ago - Reply: 1 - Views: 25

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re