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 trialMonika Agarwal
55 Pointsthe alert does not work as per the video.in my case both the alerts popped simultaneously one after the other
as per the video the sequence of the statements should be first alert then page and then alert .
4 Answers
Steven Parker
231,271 PointsIt could be the browser.
Not long ago, it was common for browsers to display page info while the JavaScript was running, but now it's more common for the browser to wait until the JavaScript program finished before displaying the rendered page.
So it would make sense that with modern browsers, both alerts would be displayed as the program runs, but anything written to the page would not be seen until the program ended. The browser used in the video probably had a different behavior.
Andrew Phythian
19,747 PointsThe latest version of Safari appears to do precisely this. Both alerts appear before the document.write part is written to the page.
Aleksandra Klochko
9,511 PointsThe same in Chrome
amin mbarki
2,110 Pointssame with me i'm using chrome on w10
Steven Parker
231,271 PointsAs I said, that's the way browsers work now.
amin mbarki
2,110 Pointsgot that ;)
Luis Onate
13,222 PointsLuis Onate
13,222 PointsCould you paste your code so we can see it? If you paste your code between sets of 3 backticks (```) we'll be able to see if more clearly.