Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 709645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:31:34+00:00 2026-05-14T04:31:34+00:00

What bad things happen at the moment document.write() is invoked? I’ve heard bits and

  • 0

What bad things happen at the moment document.write() is invoked?

I’ve heard bits and pieces about document.write having an adverse impact on the DOM or on the use of Javascript libraries. I have an issue in front of me that I suspect is related, but have not been able to find a concise summary of what damage the method does.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:31:35+00:00Added an answer on May 14, 2026 at 4:31 am

    Use of document.write() will break a web page – destroying and overwriting the entire DOM – if it’s called after the document has finished being parsed. This is considered a poor use of document.write() and is/was the reason for criticism of a lot of older scripts.

    window.onload = function ()
    {
        document.write("Oops!");
    }
    

    Generally though, it’s acceptable and rather widely used at parse-time to add something dynamically to the page in a synchronous manner:

    <div>
      <script type="text/javascript">
      document.write("Well I'll be, your browser supports JavaScript!");
      </script>
    </div>
    

    It’s mostly used by ad publishing services for adding the advertisements to a page, some Google APIs also use it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Many bad things happened and continue to happen (or not, who knows, anything can
What are the bad things that can happen when I don't close the stream?
When programming in the two IDEs i used, bad things happen when i use
Is there a "very bad thing" that can happen &&= and ||= were used
Apple really had bad documentation about how the provider connects and communicates to their
I was hoping someone could explain to me what bad thing could happen in
Is it a bad thing to have two xml columns in one table? +
Why might using a long long in C or C++ be a bad thing?
How bad is it to use Location Manager to retrieve the location information when
Sorry I'm really bad at regexes, I finally hacked osmething to work in ruby.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.