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) 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