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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:36:57+00:00 2026-05-26T11:36:57+00:00

I want to start manipulating a DOM element as soon as it’s available, to

  • 0

I want to start manipulating a DOM element as soon as it’s available, to minimize the time that it might appear in its original state on screen. I know in YUI you’d use YAHOO.util.Event.onContentReady and I’m pretty sure you’d use bind in jQuery. I’m new Dojo, and I’m not sure: What’s the “Dojo Way” to do this?

UPDATE: I specifically don’t want to wait for the whole page (which is ridiculously data-heavy; the markup alone is potentially a MB or more) to load. I want to immediately start looking for the element in the DOM and start processing as soon as it’s there, without waiting for ALL the markup to download, be parsed, and inserted into the DOM—that could take a relatively long time. I want to start looking at the DOM and get to work as soon as this tiny fragment is there. Given that constraint, isn’t dojo.ready a poor fit? My understanding is that it waits for the entire DOM to be ready, similar to onDOMReady.

  • 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-26T11:36:58+00:00Added an answer on May 26, 2026 at 11:36 am

    The most precise way of injecting functionality after a piece of DOM is added to the tree is to have the <script> that requires it placed directly below it in markup. It seems less sexy than something like onContentReady, but onContentReady is just a polling mechanism that may end up executing your callback around the same time as domready, anyway, long after the relevant DOM subtree is ready for scripting.

    Browsers can assemble a DOM tree pretty fast. And with a polling solution such as onContentReady, you’re slowing down the page assembly/render by having to execute the code that searches for the targeted element(s) every few milliseconds.

    I’d stick with keeping your <script>s at the bottom of the <body> or if you must, putting the must-run-now-damnit code in a <script> after the required markup.

    I am not familiar with dojo’s API, so I can’t answer your specific question wrt dojo if the above is not helpful.

    (edited to escape the leading < in tags so they would display)

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

Sidebar

Related Questions

I want to start a calculation task that will last for a couple of
I want to start off by saying that I have almost no experience with
I have a situation like this: start(); <Some code> end(); I want start() function
I want to start several threads, retrive data from net, perform some actions with
I want to start a phar script as an executable, directly by doing foo.phar
I want to start manage application ( Settings -> Application -> manage application ->
I want to start an activity when the user presses the space bar. My
I want to start a background process in a Java EE (OC4J 10) environment.
I want to start coding in Python or Ruby. Since I own a Lego
I want to start an application which will use ajax push, however the web

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.