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 trialJacob Anderson
7,888 PointsI am pretty sure my code is right and I have gone over it a few times but it's still not displaying.
Pretty sure I have my code copied correctly from this lesson but maybe I am just missing something. My problem is that the preview is blank and when I open up my console to see if I have any errors it shows that everything is working correctly.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Circles</title> <link rel="stylesheet" href="css/styles.css"> </head> <body id="color"> <script> src="js/script.js"</script> </body> </html>
var html = '';
for ( var i = 1; i <= 10; i += 1 ) { html += '<div>' + i + '</div>'; } document.write(html);
4 Answers
Nick Yoho
6,957 PointsMake sure your script.js file is in the js folder, the code looks correct to me
Gonras Karols
17,357 Pointsplease notice your src attribute is outside the script tag - <script> src="js/script.js"</script>, it should be <script src="js/script.js"></script>
Tyler Corum
3,514 PointsYou have to save the HTML file as well as the JS file. Otherwise the Workspace loads the default (pre-saved) HTML file. (and thus will lack the code to find/run the script)
gagan singh
Full Stack JavaScript Techdegree Student 12,889 Pointsye i know both of them are saved not to sure whats going on .
gagan singh
Full Stack JavaScript Techdegree Student 12,889 Pointssame idk why mine is doing that i have checke multiplie times spelling and everything in the console it keeps saying it s not found and i have saved both pages html and script.js
Jacob Anderson
7,888 PointsJacob Anderson
7,888 PointsIt works now for some reason. Maybe my web browser was doing something funny. Thanks though !