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 trialIan Kjera
2,557 PointsCode doesn't run from temp.js
I have entered the same code as in the video in my workspace. When I load and refresh the page, the function does not run and the console does not log anything. However, if I manually paste the code into the console, it works. Does anyone know why this is happening? I would like to get the function running automatically. My temp.js is linked the index.html
3 Answers
Erin McCulloch
10,098 PointsThis exact same issue is happening to me. The code works if I paste it into the browser console but won't run from the workspace preview. I have the code saved and the js file is linked correctly in the index.html file.
Josh Prakke
4,412 PointsNot Knowing what your code looks like I know I had issues getting it to work as well. when i finally got it to work it looked something like this. https://w.trhou.se/u01128rns1 Edit: Wrong URL
Jennifer Nordell
Treehouse TeacherHi there, Ian! There are a couple of possibilities here. So let's check some basics first. First, make sure your file is saved. If there's an orange dot on the tab, it means that the file has changes that haven't yet been saved. Because you've already tried refreshing the page, we can rule that out. However, it is possible that your browser is loading in old cached data instead of your newly altered JavaScript. Try clearing the browser cache or launching in a new private tab and see if it will run then.
If none of these work, we're going to need to see a snapshot to your workspace. You can create a snapshot by clicking the icon on the upper right-hand side of your workspace and link it to us here.
Hope this helps!
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherCan you post a snapshot to your workspace please?
Erin McCulloch
10,098 PointsErin McCulloch
10,098 PointsHere is a snap... https://w.trhou.se/v4rtq7fwop