0

I create an excel web add-in project using Visual studio 2019;
now I make some changes in parser.js a js file in the project,then press F5 to debug,when I step into the code in parser.js,I found it actually run the code in the "parser.js[dynamic]" which is the old version.
I've tried several times,restart,even restart my computer,no use.
What I did wrong???

thanks for JPO's answer,but I got something wrong.

today I changed my code, also my html code, html codes I change are as follows:

<script src="Scripts/Parser.js?version=1.3" type="text/javascript"></script>
<script src="Home.js?version=1.3" type="text/javascript"></script>

yes, the old version is ?version=1.2.
Then press F5 to debug and I get this:
the DOM Explorer Home.html and Home.html

as you can see,the Home.html is changed but the DOM Explorer isn't
it seems like the Home.html has been cached.I wonder if I did something wrong and what should I do?

if you need more information please tell me and I'll post

  • Have you tried to empty your caches? It looks like a caching problem. Try adding ?version=1 to the parser.js when you include it in your html file. Otherwise please always post more details to your question. Example codes are really great way to start. – jPO Jul 14 '20 at 10:20
  • wow ! it works ,thank you very much and I will post my code next time – HandsomeLeo94 Jul 14 '20 at 12:45
  • I will add an answer for others to see this is a "closed" question, please mark it as accepted answer. I am glad we could help you! – jPO Jul 15 '20 at 07:12

1 Answers1

0

as mentioned in my comment, this looks like a typical caching problem. Browsers tend to cache resources which aren't supposed to change often. E.g. styles or scripts. Therefore for development, it might be necessary to have tools like "Clear Cache" installed in the browser to clear the caches quickly. Or if it is just one file you are working on, then appending a get parameter e.g. ?version=1 (and increasing the value every time you update code inside the parser.js should be enough. Just don't forget to remove the parameter when you publish your code as the page load times will suffer.

Welcome to our community!

jPO
  • 2,502
  • 1
  • 17
  • 26
  • oh my gosh!seems it works by coincidence.maybe the html file is cached,so every time I run,it execute the old version,I update my problem and post picture of my code,I wonder if I did something wrong? – HandsomeLeo94 Jul 17 '20 at 02:48