Chrome and Firefox does refresh all js file except one - javascript

I'm running an application on jBoss.
In one page there are many js files. Chrome and Firefox see the changes on all js file when I reload the page, except one.
I open Chrome (firefox) in unknown mode, disabled the cache of Chrome console (Firefox console), reload the page, clean and restart the application server and rebuild the application.
Nothing.
I don't know what to do.

When linking the scripts on you pages you can put something after the file like
<script language="JavaScript" src="<file_name.js>?yyyymmdd"></script>.
This "yyyymmdd" can be the current Date/datetime (never caches) or the last modification date of the js file you are including (it cancel the cache only when you modify the script).
That is the approach we use.

In chrome, go to developer tools(press F12), go to Network panel, there check 'Disable cache' option and load your page..

Related

How to open web console like Chrome console in Visual Studio Code preview side and see JavaScript changes dynamicaly?

Main goal is that I would like to see dynamic web console, In VSCode side preview, like Chrome console in this picture (VSCode with separate Crome console) and that it will updates dynamicaly.
Now I am doing like that:
created index.html file and included
src="laikinas.js">
opened index.html with live server
extension, it opened new Chrome browser window.
presses F12, tab "Console"
resized both VSCode and Chrome browser.
As you see this is long way, and if I screating new file with another name I also need to include it in index.html. Another my way was:
Opened VSCode debug console
pressed Cntr+F5
But this console I do not like. One of this that the Chrome console show errors better with links to exactly point.
I also tryed extension like this one "Quick HTML Previewer" to see dynamic changes, but this extension can show only frontend, I need a console.
I think the closest thing is using npm nodemon to watch the files on your local directory. Then when you save in VS you can refresh the page in your browser to see the changes you made. Not quite as nice as chrome because of the extra clicks.
https://www.npmjs.com/package/nodemon
https://www.youtube.com/watch?v=4N0d8HhU5DE

Chrome - "disable cache"

I am using Chrome Dev Tools to debug a web app I'm making. I'm curious about this "Disable cache" button in Chrome Dev Tools:
Could someone please tell me what this does?
I've noticed some problems using Offline.js and discovered if I check "Disable cache" here in Dev Tools it works okay.
But what exactly is that doing? I am using Cache Manifest in my app so it works offline, but if clicking "Disable Cache" in Chrome Dev Tools is actually just disguising a bigger problem that's not useful to me.
Essentially what I think is happening:
The image I am loading (see Offline.js - checking while online?) which Offline.js checks for to determine if the user if online or offline, that image is being cached
Hence after the first load, it always appears online
If I disable cache in Chrome Dev Tools, it works correctly because it's loading a fresh copy of the image each time.
Any words of wisdom are welcome.
The disable cache checkbox disable cache, it means every time you connect a server, you will download again the WHOLE website, even already downloaded images.
This may be used when you debug an application that have cache problem (you have cached informations & parsing them but the real data has been changed)

IE11 not showing javascript files in debugger

in IE11 I display the developer tools, then click on the debugger (or Ctrl-3) and it displays the debugger. In the top left there is the folder drop down which has a list of js files usually, but in this case none are displayed, only the html file is displayed.
The site I'm looking at is on my local PC running in IIS if it matters. I can go to the same site on our build box and the js files are displayed in the debugger. I've restarted everything a number of times. I've checked the network monitor in the developer tools and it downloads the javascript files fine, I just can't see them in the debugger. It's worked previously fine (a couple of weeks ago when last I had to debug an IE problem), Any suggestions?
running IE 11, Windows 7
Go to Internet Options -> Advanced. Uncheck Disable script debugging, Disable script debugging (Others)
Must be a problem with my IE11 install - I downloaded an IE11 vm from modern.ie and it works fine there. (setup information here for any curious https://superuser.com/questions/248569/virtual-pc-cant-access-localhost)
Please go to the Debugger tab in Developer tools. Hit Ctrl+O and type your file name.
Alternately, you can click the Folder icon and search for your file.

Same Javascript code but not same act

//Edit
Hello.
I have made a website and uploaded to the host. So, the codes what are in my localhost and in the website host are same. Everything works except one JavaScript(jQuery) action(A dropdown menu). On my localhost it works perfect, on the website host, it drops and rises again and than doesn't drop again.
site : http://www.hastahakki.com/index.php?page=anasayfa
The problem on the big buttons like "Doğru Hastane Seçimi" , "Hasta Şikayetleri"
How do I do?
It's rare for pure client code to work differently in a hosted environment provided it is uploaded properly and the same browser is used.
First I would check it's not a cache issue by clearing my browser cache.
Then I would view it in a browser with modern developer tools, which is most browsers with the latest version (Firefox requires the excellent Firebug plugin). In Chrome for instance, looking at the Network output will show you if any resources are failing to load, and the Scripts view will show you any local JavaScript errors that might be triggered by the hosted version.

Any way to see the order in which the .js are loaded using the browser (chrome or firefox)?

any way to see the order in which .js are loaded using the browser (chrome or firefox)?
Regards
Javi
Firebug should show you the order of the JS files that are being loaded, it will also show details such as the response headers, time taken to download etc. It works as a native plugin for FF, there is also a lite version for Chrome but I don't think this can track JS files.
http://getfirebug.com/
For Chrome the Developer Tools should show the scripts that are being loaded, their order, time etc etc.
ctrl-shift-j in chrome, click resources

Categories

Resources