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 trialDarius Johnson
664 PointsMy workspace page won't connect to my JavaScript basics window tab.
I type in the JavaScript code exactly as instructed in the video. I refresh the page and nothing. Also my workspace page and JavaScript basics tabs are different from the video. I select the eye icon on the far right in the workspace window and it goes into a separate browser window the Javascript basics. Can someone assist me please?
4 Answers
Robert Manolis
Treehouse Guest TeacherHI Darius Johnson, thanks for the additional info. So on line 7 of the index.html
file, you're linking a JavaScript file named javascript.js
from a js
folder. There's a couple problems with that. First, that JS file that you're linking is an empty file. There's nothing in it. On line 7, try changing that src
attribute value from this, "js/javascript.js"
, to this, "js/preview.js"
.
And ideally, your JS should generally be added to the index.html
file just before the closing </body>
tag. So you can move that code from line 7 and place it between the code on lines 12 and 13.
Robert Manolis
Treehouse Guest TeacherHi Darius Johnson, hard to say what the problem might be or offer any suggestions without more information. Please share a link to the video or step you are working on. And share a snapshot of your workspaces, which you can do by clicking on the camera icon near the upper right of the workspace window. Then we can take a closer look at the situation and try to provide some helpful and actionable feedback.
Darius Johnson
664 PointsHi Robert, I'm doing the "Add to JavaScript to HTML" video.. I'm trying to link the js file to the index.html file. Then have it display on the browser. I try to link the files and do the code exactly as asked and nothing. It won't display on the browser.. I did the snapshot and it came out blank https://w.trhou.se/s5q8mhirn4 https://w.trhou.se/1f3j04qwgk I hope this helps you understand my question better.
Nga Pham Thi
Full Stack JavaScript Techdegree Student 5,616 PointsHappened same to me. I got the screen showed below details instead of run my code when I clicked on 'eye' icon. Can you pls help @Robert?
Index of /
[ICO] Name Last modified Size Description
[DIR] html/ 2021-09-16 15:33 -
[DIR] js/ 2021-09-16 15:30 -
jb30
44,806 PointsDid you move, rename, or delete the index.html
file?
Darius Johnson
664 PointsDarius Johnson
664 PointsGood-morning Robert! Thank you so much! It worked you're awesome! I truly appreciate it.
Robert Manolis
Treehouse Guest TeacherRobert Manolis
Treehouse Guest TeacherCool! Thanks, Darius Johnson. Happy to help.
And if you're satisfied with the response you've received, feel free to mark as best answer and/or upvote.