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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:23:09+00:00 2026-05-27T15:23:09+00:00

I use the following code to load my JavaScript files. which works fine for

  • 0

I use the following code to load my JavaScript files. which works fine for me

<script  src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" ></script>
<script  src="../js/jq/jquery.ui.core.js" ></script>
<script  src="../js/jq/jquery.ui.widget.js" ></script>
<script  src="../js/jq/jquery.ui.mouse.js" ></script>
<script  src="../js/jq/jquery.ui.mouse1.js" ></script>
<script  src="../js/jq/jquery.ui.mouse2.js" ></script>
<script  src="../js/MyLoader.js" ></script>

but when I change it into the following code And add async=”async” to script.

<script  src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" async="async"></script>
<script  src="../js/jq/jquery.ui.core.js" async="async"></script>
<script  src="../js/jq/jquery.ui.widget.js" async="async"></script>
<script  src="../js/jq/jquery.ui.mouse.js" async="async"></script>
<script  src="../js/jq/jquery.ui.mouse1.js" async="async"></script>
<script  src="../js/jq/jquery.ui.mouse2.js" async="async"></script>
<script  src="../js/MyLoader.js" async="async"></script>

It has strange behavior sometimes all javascript files loading sometime some javascript files are missing .

I check this in Chrome.
According to Documentation It has to be load but Asynchronously not or badly loading ??
The most important thing for me is to force MyLoader.js load as the last javascript then it can use the resources in the other libarary. So Question is how to delay one JS file to load as last javascript file ??

example of erorr in broswer

query.ui.mouse.js:20Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'widget'
jquery.ui.widget.js:67Uncaught TypeError: undefined is not a function
jquery.ui.widget.js:67Uncaught TypeError: undefined is not a function
loader.js:6Uncaught TypeError: Object [object Object] has no method 'draggable'
2event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future.
  • 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-27T15:23:09+00:00Added an answer on May 27, 2026 at 3:23 pm

    If the main problem you are trying to solve is to make sure that MyLoader.js is loaded last and that everything else is loaded before it, then simply remove the async attribute from all your script tags. The browser will then load and execute them in the order encountered in the file.


    For more info on using async, you cannot make multiple JS files that depend upon each other and must be loaded in a specific order all be async. They may then load in the wrong order and cause errors.

    For example, all the jQuery.ui files depend upon jquery.min.js so it MUST be loaded first. When you load things async, their order is no longer guaranteed so you are rolling the dice on whether they will be loaded in the correct order or not.

    The best candidates for async loading are scripts that don’t depend upon any other async scripts, scripts that aren’t required for the initial rendering of the page and scripts that somewhat stand on their own. They do their own work when they load and the timing of when that work is done is not critical or coupled with anything else in the page. A perfect example of such a script is a script that records web statistics on a remote server. It isn’t involved in the initial rendering of the page, it doesn’t matter if it happens right when the page is loaded or a second or two later and it isn’t couple with anything else in the page.

    See this article for some good discussion of the topic.

    If you really wanted to load a bunch of dependent scripts async and load them in a specific order, then you would have to use a bunch of additional code to coordinate that. That level of order and coordination will not happen automatically with the async attribute.

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

Sidebar

Related Questions

I'm trying to use the following code # LOAD XML FILE $XML = new
I Use the following code to load png image: UIImage *imageBack1 = [UIImage imageNamed:@Bar1.png];
I use the following code to load an image into an scroll view. The
I use the following code to create countdowns in Javascript. n is the number
Trying to use this following script to load a page so that I can
I have the following file file: <html> <head> <title></title> <script type=text/javascript src=/Prototype.js></script> <script type=text/javascript>
I use the following jquery code to load some date on a specific event
I use the following code snippet to load data from google fusion table as
I have the following HTML page: sample_page.html: <h1>sample html page</h1> <script type=text/javascript src=sample_page.js/> The
I need to load JavaScript code (which I don't have control over) from a

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.