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 trialChristopher Shaw
10,035 PointsJavaScript not running
My javascript is no longer displaying when I run the programs. I'm following the videos line by line, my javascript and pop ups are enabled, I've used different browsers and different computers, but still my programs won't run. Maybe I'm blind but I'm pretty sure all the code is correct to at least prompt the question. Thanks!
6 Answers
Fernando Boza
25,384 PointsTake a look at your for statement. A traditional one is like
for (var i = 0; i < questions.length; i += 3) {
question = questions[i][0];
answer = questions[i][1];
response = prompt(question);
response = response.toLowerCase();
}
You forgot to add the BOOL operation < or >
Christopher Shaw
10,035 PointsI'm trying to figure out how to post the images haha having a little difficulty
Jonathan Grieve
Treehouse Moderator 91,253 PointsHere's the markown code for images :)
![alt text](/path/to/img.jpg "Title")
Try something like that, with a relative file path to your image whereever on the internet it is :) I fixed up your JS code in the meantime.
Christopher Shaw
10,035 Pointsheres a link, I cant figure out how to post the image.
I've corrected the questions.length in the second condition also and it still wont run
Fernando Boza
25,384 Pointsin you for loop, take away the () from the 2nd condition. question.length;
Christopher Shaw
10,035 PointsI did that, sorry its not updated in the picture, and its still not running
Fernando Boza
25,384 Pointscan you share you workspace
Top right, select share workspace icon and create share. Once it's made, open the shared workspace and copy and paste the link.
It would help us view the livecode
Christopher Shaw
10,035 PointsWell it seems to be working now! Thanks Fernando Boza and sorry for the sloppy post, its my first one so I wasnt sure how to share images and all.
Fernando Boza
25,384 PointsNo worries, keep going with the good work
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsCould you post your code for us so we can check it out? It might be a simple issue of a file path not correctly linking to your JS file. :-)