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) Storing and Tracking Information with Variables The Variable Challenge

Natalia Karolinskaya
Natalia Karolinskaya
9,367 Points

When I use prompt() for 3 questions, each dialog box pops up twice. Can anyone explain me why?

Prompt dialog box pops up twice

Hello Natalia,

Could you please provide the code you are working with?

Cheers, Jacob

2 Answers

Not having seen your code but having a guess from my own experience.....

May I suggest to check your index.html code? At the end of the video, Dave instructs to make sure we link the .js file to the index.html file, which I duly did in the head section under title

However, what I hadn't noticed is that in fact, a link to story.js was already under h1, which resulted in running the program in the story.js file twice. Maybe this is what's happening for you too?

I hope it helps!

Natalia Karolinskaya
Natalia Karolinskaya
9,367 Points

Thanks Sandrine! Tha't exactly what happened!