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 trial

JavaScript JavaScript Basics (Retired) Working With Numbers Doing Math

Richard Gilmore
Richard Gilmore
21,429 Points

JavaScript statements do not run. Do not see any errors in console. How to fix problem?

None of my statements run. Only see headline from HTML in preview. No errors show.

Sample in JavaScript file: var secondsPerMin = 60; var minsPerHour = 60; var hoursPerDay = 24; var daysPerWeek = 7; var weeksPerYear = 52; var yearsAlive = 26; var daysPerYear = 365;

var secondsAlive = secondsPerMin * minsPerHour * hoursPerDay * daysPerYear * yearsAlive; document.write("I've been alive for " + secondsAlive + " seconds.");

FΓ‘bio Tavares da Costa
FΓ‘bio Tavares da Costa
11,985 Points

I looks like the file is not properly linked.

type it inside the dot js file:

alert('JS properly linked!');

If you do not see an alert box, that's the diagnostic. You must see JS properly linked! when the path/to/file.js is correct.

Go for for Atom.io. It will make your job easy.

1 Answer

Richard Gilmore
Richard Gilmore
21,429 Points

Thanks, I'll try it out as soon as possible.