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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:34:43+00:00 2026-05-25T21:34:43+00:00

If I load a script asynchronously like this <script type=text/javascript> (function () { var

  • 0

If I load a script asynchronously like this

<script type="text/javascript">
    (function () {
        var js = document.createElement('script');
        js.type = 'text/javascript';
        js.async = true;
        js.src = '<%=BundleTable.ResolveUrl("~/js") %>';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(js, s);
    })();
</script>

what event fires once the async stuff is finished loading and the dom is finished loading?

  • 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-25T21:34:44+00:00Added an answer on May 25, 2026 at 9:34 pm

    Every event has it’s own notification mechanism so there is no generic answer. For example, you can read about how to detect when a dynamically loaded script is done loading here and here. These days, you can save yourself a ton of time by using a good framework like YUI or jQuery as they most have built-in cross-browser support for these types of events.

    For the DOM finished loading, there is no single cross-browser mechanism that gets you the earliest possible time when it’s finished loading. If you look at a jQuery implementation of $(document).ready(), you will see several techniques employed (listening for “DOMContentLoaded” event, the earliest time that a setTimeout() will fire, listening for window load(), document onreadystatechange event, etc…) in order to support this functionality cross browser.

    The window.onload event will guarentee safe DOM access, but it also waits for all images to finish loading which is much later than neccessary. These other techniques are used to get earlier safe access.

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

Sidebar

Related Questions

This is how I load jQuery: <script src=http://www.google.com/jsapi></script> <script type=text/javascript> function OnLoad() { insert
<script type=text/javascript> var chart; $(document).ready(function() { // Define the options var options = {
Google allows you to load jQuery asynchronously like so: <script src=http://www.google.com/jsapi?key=... type=text/javascript></script> <script> //<![CDATA[
After loading a PHP template (using jQuery's load function), this simple script won't make
In a script like the following, would the load functions be called in asynchronously
given I asynchronously(!!) load several JavaScript files with an asynchronous script loader (that writes
I have a java script function that i have called on body load mousemove()
I am working on a javascript app that users load via a configurable script
I'm using the following html to load dojo from Google's hosting. <script src=http://www.google.com/jsapi></script> <script
I am building a javascript widget that should load asynchronously. Problem is that there

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.