Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Introducing JavaScript Your First JavaScript Program

Chaitanya chowdary
Chaitanya chowdary
2,045 Points

The second line which has document.write is not getting executed until the last alert is executed. This is contradicting

The second line which has document.write is not getting executed until the last alert is executed. This is contradicting to what was explained in the video.

3 Answers

I see the same behavior in Chrome, but Firefox behaves as the video describes. Chrome has opted to render the page differently than the code is written. But the overall lesson of the video is correct - statements are processed in order.

Chaitanya chowdary
Chaitanya chowdary
2,045 Points

You are right , I observed the difference in 2 browsers. However, how can we know that these kind of things work differently on different browsers ? I mean we can have issues from users who use different browsers rite ?

Absolutely, and there is software designed to test sites as different browsers.

i got the same problem with this, but i using avast secure browser, just want to ask question how we can fix this issue with the browsers?? thannks