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 7926109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:36:50+00:00 2026-06-03T18:36:50+00:00

<script> document.write(before write h1.js+<br/>); document.write(<script src=’h + 1.js’><\/script>); document.write(after write h1.js +<br/>); </script> h1.js

  • 0
   <script>
      document.write("before write h1.js"+"<br/>");
      document.write("<script  src='h" + "1.js'><\/script>");
      document.write("after write h1.js" +"<br/>");
   </script>

h1.js file:

This is h1.js


In IE the result will be:

  1. before write h1.js
  2. after write h1.js
  3. This is h1.js

Firefox Chrome Safari Opera:

  1. before write h1.js
  2. This is h1.js
  3. after write h1.js

How could I write a script to make it the same order in all brower.

  • 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-06-03T18:36:51+00:00Added an answer on June 3, 2026 at 6:36 pm

    This should work the same in all browsers:

    <script>
        document.write('before h1.js');
    </script>
    <script src="h1.js"></script>
    <script>
        document.write('after h1.js');
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this script: $(document).ready(function() { $page = jQuery.url.attr(file); alert(page); }); but I get
If I call document.write() inside a script tag, can I trust that it will
Javascript can manipulate the document the browser is displaying, so the following: <script> document.write(<table><tr><td>Hola</td><td>Adios</td></tr></table>);
The following script returns 20 instead of 21! var d = new Date(2010/03/21); document.write(d.getDate());
I tried to do <script type=text/javascript> //<![CDATA[ document.write('<meta http-equiv=refresh content=0;url=index.php />'); //]]> </script> but
<html> <body> <script type=text/javascript> var str=Welcome to Microsoft! ; var val=Microsoft!; document.write(str.replace('/'+val'+/gi', W3Schools)); </script>
<HTML> <HEAD> <title>Login</title> <script type=text/javascript src=http://script.auction.co.kr/common/jquery.js></script> <script type=text/javascript> $(document).ready(function() { $(:input[name='txtPassword']).blur(function(e){ $(this).css(background-color,white); }); $(:input[name='txtPassword']).focus(function(e){
I am using a script before page load to write some html into my
Code: <script type=text/javascript> var uri = %^my test**.asp?name=ståle&car=saab; document.write(decodeURI(uri)); </script> Error: Line: 6 Error:
I want to mimick this behavior: <script src=console.log.1.js></script> <script>console.log(2)</script> <script>console.log(3)</script> That logs out: 1

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.