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