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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:08:09+00:00 2026-05-13T10:08:09+00:00

A Google Closure library team member asserts that waiting for DOMContentReady event is a

  • 0

A Google Closure library team member asserts that waiting for DOMContentReady event is a bad practice.

The short story is that we don’t want
to wait for DOMContentReady (or worse
the load event) since it leads to bad
user experience. The UI is not
responsive until all the DOM has been
loaded from the network. So the
preferred way is to use inline scripts
as soon as possible.

Since they still don’t provide more details on this, so I wonder how they deal with Operation Aborted dialog in IE. This dialog is the only critical reason I know to wait for DOMContentReady (or load) event.

  1. Do you know any other reason?
  2. How do you think they deal with that IE issue?
  • 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-13T10:08:10+00:00Added an answer on May 13, 2026 at 10:08 am

    A little explanation first: The point with inline JavaScript is to include it as soon as possible. However, that “possible” is dependent on the DOM nodes that that script requires being declared. For example, if you have some navigation menu that requires JavaScript, you would include the script immediately after the menu is defined in the HTML.

    <ul id="some-nav-menu">
        <li>...</li>
        <li>...</li>
        <li>...</li>
    </ul>
    <script type="text/javascript">
        // Initialize menu behaviors and events
        magicMenuOfWonder( document.getElementById("some-nav-menu") );
    </script>
    

    As long as you only address DOM nodes that you know have been declared, you wont run into DOM unavailability problems. As for the IE issue, the developer must strategically include their script so that this doesn’t happen. It’s not really that big of a concern, nor is it difficult to address. The real problem with this is the “big picture”, as described below.

    Of course, everything has pros and cons.

    Pros

    1. As soon as a DOM element is displayed to the user, whatever functionality that is added to it by JavaScript is almost immediately available as well (instead of waiting for the whole page to load).
    2. In some cases, Pro #1 can result in faster perceived page load times and an improved user experience.

    Cons

    1. At worst, you’re mixing presentation and business logic, at best you’re mixing your script includes throughout your presentation, both of which can be difficult to manage. Neither are acceptable in my opinion as well as by a large portion of the community.
    2. As eyelidlessness pointed out, if the script’s in question have external dependencies (a library for example), then those dependencies must be loaded first, which will lock page rendering while they are parsed and executed.

    Do I use this technique? No. I prefer to load all script at the end of the page, just before the closing </body> tag. In almost every case, this is sufficiently fast for perceived and actual initialization performance of effects and event handlers.

    Is it okay for other people to use it? Developers are going to do what they want/need to get the job done and to make their clients/bosses/marketing department happy. There are trade-offs, and as long as you understand and manage them, you should be okay either way.

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

Sidebar

Related Questions

Google Closure library provides export symbols option to provide access to constructors through window
The Google Closure (GC) Javascript Library makes it very easy to create an AutoComplete
I have a JavaScript file that I ran through the Google Closure compiler, and
I'm relatively new to the Google Closure library and my current obstacle is getting
We have an application that uses both the google closure and dojo libraries. We
This solution must use the google closure javascript library and not any other javascript
I am trying to teach myself the Google Closure javascript library. I am examining
I had downloaded the Google's closure library from the downloads list here the closure-library-20110323-r790.zip
I came across the goog.math.isFiniteNumber function in the Google Closure Library . What it
I have been tinkering with drag and drop in Google Closure libraries: http://closure-library.googlecode.com/svn/docs/class_goog_fx_DragDropGroup.html I

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.