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

  • SEARCH
  • Home
  • 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 6087771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:54:30+00:00 2026-05-23T11:54:30+00:00

I understand document.write prevents the executing of following javascript. For example the document.write will

  • 0

I understand document.write prevents the executing of following javascript.

For example the document.write will prevent the execution of the following javascript until the document.write block has completely executed.

<!doctype html>
<script>
document.write('<script>alert(1)<'+'/script>');
alert('2');  
</script>

http://jsbin.com/alefob

You can take this even further and require for javascript to be loaded remotely before executing the following script.

<!doctype html>
<script>
document.write('<script src="remote_script.js"><'+'/script>');
alert(remote_script_variable);  
</script>

Obviously I could do a callback, but that’s not what I’m looking for.

Question

Basically do any other functions have this unique functionality of preventing scripts from loading until completion (others functions that I might want to avoid)?

Assuming that no other functions have this unique functionality. Can document.write ever be used after page load without overwriting the pages content?

Already Understood

I know you can do the following along with using yennop.js

var script = document.createElement('script');
var currentScript = document.getElementsByTagName('script')[0];
currentScript.parentNode.insertBefore(script,currentScript);
script.src = '//some url';
  • 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-23T11:54:30+00:00Added an answer on May 23, 2026 at 11:54 am

    Synchronous XHR stops the world in many browsers until the response is received or the request errors out.

    And obviously, document.writeln stops the world in the same way as document.write.

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

Sidebar

Related Questions

Here's the sample code: var d = new Date(2010-06-09T19:20:30+01:00); document.write(d); On FF3.6 this will
In tutorials I've learnt to use document.write . Now I understand that by many
NSString *searchString = @Lyngbø; NSLog(%@,[searchString stringByAddingPercentEscapeUsingEncoding:NSUTF8StringEncoding]); This gives me : Lyng%C3%B8 <script type=text/javascript> document.write(escape(Lyngbø));
I am starting to write an application that will output an OpenOffice document. The
From MSDN document i understand ( I am not sure,i understand perfectly ) :
I read the SDK document, but can not understand some details, need some help.
I am about to draw/document for some client-server connection establishing code to better understand
I'm a beginner. I write simple json jquery php code to help understand the
<html> <body REMonload=document.location.assign('index2.php?w=' + window.innerWidth + '&h=' + window.innerHeight);> <script language=javascript> document.write('w=' + window.innerWidth
While I was learning about how to write an XHTML document with XML writer

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.