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 trialZach Hope
12,486 PointsDocument write also not working here.
var secondsPerMin = 60; var minsPerHour = 60; var hourPerDay = 24; var daysPerWeek = 7; var weeksPerYear = 52; var secondsPerDay = secondsPerMin * minsPerHour * hoursPerDay; document.write("There are " + secondsPerDay + " seconds in a day");
can't get anything to show up in the preview , neither does it work with my copy and paste into sublime text.
Tim Barbarino
5,449 PointsCould you snapshot workspace? It's an icon in the top right corner.
Tim Barbarino
5,449 PointsMy guess is the same as Chau's. Check that you have-
<script src="<name of your script>.js"></script>
in your index.html file.
2 Answers
Zach Hope
12,486 PointsGuys I feel really silly for not catching my mistake here but it’s actually just the variable “hourPerDay” it should be pluralized as “hoursPerDay” and that’s the whole issue !
Tim Barbarino
5,449 PointsDon't feel silly! Most mistakes in my experience are to do with syntax and spelling!
Ashley Shelden
4,894 PointsI had trouble getting the document.write command to work as well, and it turned out that using the contraction "I've" was my ultimate issue.
Chau Mai
2,338 PointsChau Mai
2,338 PointsMake sure you have already attached the external '.js' script file into the "index.html" file.