1

I call my JavaScript files like this:

jsfilename.js?v=1234

And on each request I change the v parameter. Second request:

jsfilename.js?v=4567

Is that a way to debug on Chrome DevTools with this variable name? Because now, every time I create a breakpoint and refresh the page, my breakpoint looses reference.

4 Answers 4

1

Use statement debugger in your JS code. Don't forget to remove it after all ;-)

Sign up to request clarification or add additional context in comments.

Comments

0

I would use console.log() to report back the variable name every time I need it. This should be able to show you the exact point where your script fails.

Comments

0

You can also disable cache while DevTool is open. Go to settings (click the 3 dots on the right and select settings) In this way you should refresh the page and not keep cache.

Errors are as mentioned in the other answer generally shown iin the console:-)

Comments

0

usually, you put ?v=xyz so that you can bypass browser cache [if the parameter is different, the browser gets the file from the server and not the cache]. this is used mostly whan you have to deal with CDN. For debugging purposes, the Javascript debugger has an option to disable cache [open debug, go to settings; is the first checkbox in the "General" panel] of course you can have problems in breakpoint persistence if the filename is diffeerent; so, as long as you're debugging, just disable cache, and, of course, don't place js file on CDN unless they're in their stable release;

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.