bdigregorio
bdigregorio

Reputation: 51

Why doesn't Chrome Developer Tools show all JavaScript files?

I have a project that uses a main JSP to include component JSPs. Each JSP has its own JS file that gets included via a script tag with corresponding url. When I open Chrome Developer tools to debug my JavaScript, it seems to only show top-level JS files.

I have tried inserting alert statements in my lower level JS to make sure the scripts are getting loaded properly, and they do indeed alert when the page is loaded. However, the JS files are not listed under the sources tab of Chrome Developer Tools.

Is this known/expected behavior, and is there a way to debug these files in Chrome?

Upvotes: 4

Views: 5656

Answers (1)

bdigregorio
bdigregorio

Reputation: 51

I noticed that for whatever reason, Chrome does not detect javascript files within script tags of included JSP files. The solution for me was to move the script tags into the top level JSP. This will have Chrome detect the file and make debugging available for that code.

Upvotes: 1

Related Questions