Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJerry Wu
1,845 PointsIn spite of the console.log command in my script.js file, nothing appears in JS console in Chrome. Why?
I have the following line of code written into my script.js file:
console.log("Program complete");
However, when I press CTRL + Shift + J to access JS console in my Google Chrome browser, the console box is completely empty--nothing is logged whatsoever. Why is this?
6 Answers
Jennifer Nordell
Treehouse TeacherI agree with Kevin Korte. There is also the possibility that your browser cache is loading in an older version of your code as opposed to your newly altered code. Try viewing the same file in a private browsing tab or clearing your browser cache and then refresh the page. If this doesn't work, then we really will need to see your code to be able to assist you further
mully BENDET
Front End Web Development Techdegree Student 3,054 Pointsmake sure you saved your work
Jerry Wu
1,845 PointsI did. At this point, I am attributing it to a browser glitch and perhaps I should have just refreshed the browser to see if that would fix the issue.
Kevin Korte
28,149 PointsAre you sure you have properly linked your JS file so that the browser will actually execute it? Would need to see more of your code to know that. From my experience, very very rarely can issues be attributed to a "browser glitch", and they are always the simplest of errors on our part
Nadav Reis
5,561 PointsCan you share the whole file? Is it just the one line of code?
Jerry Wu
1,845 Pointshttps://teamtreehouse.com/library/javascript-basics/introducing-javascript/the-javascript-console
I added the one line of code to the .js file from this workspace.
Dawson St. Julien
1,246 PointsClosing the preview tab in your browser and re-launching preview from workspaces seems to fix the issue. Must be a caching issue.