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

Each prompt dialog box opens twice! HELP

Each prompt() dialog box opens twice. I followed some of the questions people have asked before, but it doesn't appear that the story.js source is repeated in the HTML file. HELP.

https://w.trhou.se/b6ao23180s

4 Answers

you have each prompt written twice, so it opens two each. when you put prompt('enter...') it prompts but does not store the input. on the following line you put var noun = prompt('enter...') it prompts again, but that input would be stored in the noun variable.

Okay. So do I only need to write var noun = prompt('enter') ???

dont worry index.html already called the js file and i didnt realise so it was linked twice

Got it! Thank you!

Do you know why the following code would pop up two prompts? var noun = prompt("please enter a noun"); document.write(noun);