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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:19:34+00:00 2026-05-27T17:19:34+00:00

What is the most ideal way of loading javascript files? Also, I want to

  • 0

What is the most ideal way of loading javascript files? Also, I want to make sure that order of the javascript files should be maintained. If I have

<script src="javascript1.js">
<script src="javascript2.js">

on my page, then javascript1.js should load before javascript2.js

Thanks.

EDIT: Thank you for your answers, but mine question is not only related with the order of js files. I want to load js files as quickly as possible without using any 3rd party js library. The solution which is similar can be found at http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/, but using this does not guarantee the order of the files for me, atleast.

  • 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-27T17:19:35+00:00Added an answer on May 27, 2026 at 5:19 pm

    As others have said, the scripts are loaded in order of placement on the page (unless they are wrapped in javascript to be loaded in later)

    Putting the script tags at the bottom of the page can assist with the loading process for both old and new browsers. Although some scripts might (like modenizer) need to be loaded earlier on in the process. A good example can be seen at http://html5boilerplate.com/ on the index code sample.

    Edit:

    Following your edit, there is this info which can help

    <script type="text/javascript">
      document.writeln("<script type='text/javascript' src='Script1.js'><" + "/script>");
      document.writeln("<script type='text/javascript' src='Script2.js'><" + "/script>");
    </script>
    

    The full documentation on this can be read here (including crevets of other methods) http://blogs.msdn.com/b/kristoffer/archive/2006/12/22/loading-javascript-files-in-parallel.aspx

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

Sidebar

Related Questions

wondering what the most ideal way would be for loading a large number of
We have an application that requires loading A LOT of configuration data at startup.
Most of the time, when designing an desktop application, I love to make the
Most of the ASP.NET MVC paging solutions I have found by googling look like
I am using a JavaScript script that tells me if specific image URLs are
I have an application that requires to use QWebView::setContent() to load some HTML content
Most server-side-scripting languages have an exec function ( node , php , ruby ,
I currently have a winform with a listbox control that allows a user to
I have a marklogic (4.2) database that contains tens of thousands of large-ish, complex-ish
Let's say that I have a bunch of objects (thumbnails in a matrix for

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.