Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Chrome external javascript edit problem in Visual Studio

Posted on 2012-09-14
10
Medium Priority
?
837 Views
Last Modified: 2012-09-15
Has anyone seen this before? When using Chrome while debugging with Visual Studio, if I edit an external JavaScript file, Chrome keeps using the old file unless I rename the file. It's the stickiest caching I've ever experienced.

And that means renaming the file, changing its name as the "src" attribute in the JavaScript include line, and changing the name in the solution explorer. What a pain! Does anybody know about this? Am I skipping a step? IE-8 works fine -- I only have to make edits, like normal.

Mind you, I'm not trying to use the V/S debugger to step into the Chrome browser JavaScript. But I am doing a view source on Chrome, and I'm also looking at the script markup using the Chrome Develper Tool. In all cases, it is caching the old file. Even if I quit Visual Studio and restart. The only way I could get it to recognize my edits was by doing a filename change -- this happened every time I did an edit! (So I did most of my debugging with IE, then only the final testing with Chrome -- where I found a few things I had to fix.)

Thanks.

Paragram
0
Comment
Question by:paragram
  • 6
  • 4
10 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 38399330
Goto developer tools - Spanner, Tools, Developer Tools
Bottom right corner click the Gear symbol and check disable cache
0
 

Author Comment

by:paragram
ID: 38400064
Boy, I was hoping!! But no joy. I made the change, and still, when I edit an external .js file, the changes are NOT being seen. This time I only looked inside of Developer Tools, since that's where it really counts. I changed 3 lines of code, and ran under IE and it worked fine. Chrome gave me an Uncaught TypeError because the fix I implemented was not being seen. (Basically I deleted 3 lines).

Even more shocking(!), if I edit the file INSIDE of Chrome's Developer Tools and SAVE it there (by right-clicking on it in the Sources tree and selecting Save (which then automatically updates my open copy inside of CodeWright -- so I know it's really being written to the proper folder) and then restart the V/S debugger, IT STILL goes back to the earlier version when I look at the code on the Source tab INSIDE Developer Tools!!!

I did what you said -- checked the box for Disable Cache!! Is this FUBAR or what?? Would you try what I am doing for me--remember, this is an External file. For inline JavaScript (or other edits in the .aspx file) there is no caching.

Help!!!

Paragram
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 38400106
Are you using a download manager? This could cause a cache issue. If so try disabling it.
Else use an incognito window.
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 

Author Comment

by:paragram
ID: 38400636
Now how in the heck did you figure that out?

OK, first of all, no there is no download manager. I don't even know what context that question makes sense (everything is local -- I am debugging on the same machine where I am editing the sources.)

But the incognito window. It works. The "regular" window keeps thinking it is using the old file, but the incognito window sees the new markup in the external file. WHY IS THAT? AND HOW, PRAY TELL, do I EVER get the "cognito" window to see the new edits? The kluge I was using was to rename the file twice, once to a new name and twice back to the original name -- which is really dumb. Is there no better way??

Paragram
0
 

Author Closing Comment

by:paragram
ID: 38400638
Please see my final post -- and answer if you can. - Paragram
0
 

Author Comment

by:paragram
ID: 38400642
Gary (please see my previous post) -- do you have a V/S setup? Did you try what I was doing to see if it happened for you as well?

Paragram
0
 
LVL 58

Expert Comment

by:Gary
ID: 38400659
Incognito window is like IE's in private browsing - nothing is saved, cookies deleted after the session etc
If you have a download manager it maybe interfering with the cache

I have experienced the same problem with Chrome
0
 

Author Comment

by:paragram
ID: 38400972
Gary,

Not sure if you'll keep monitoring this thread because I've accepted a solution (yours!) but I would like to learn something and you seem to have patience.

I'm not trying to say you were wrong -- but about the download manager... When I'm developing on my own box where the compiler is local (admittedly with a remote database), there's no role for a download manager, right? You were refering to a setup where I have to upload or download source or object files, weren't you?

So for my setup, the download manager issue wasn't relevant, right? (God, I know this sounds like a put-down or something. But honestly, I just want to be sure, because you are obviously a smart guy. Just tell me, in case it comes up again -- do people use download managers when they're developing "locally" like I am here? Thanks.

PS. My friends tell me I perseverate! Forgive me.

Paragram
0
 
LVL 58

Expert Comment

by:Gary
ID: 38401641
No, ignore the download manager bit, I was doing a dozen things at the same time and not thinking about it properly
0
 

Author Comment

by:paragram
ID: 38402661
Just a final kudo to Gary. He patiently answered ALL my questions and I think this will be a very useful thread for anybody else who has a similar problem.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
Over time, the online landscape has altered considerably, but that’s nothing compared to the up-and-coming trends that will shape the web design industry in the coming year. Keep reading to find out which trends will shape B2B web design in 2018.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question