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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:12:59+00:00 2026-06-03T05:12:59+00:00

Is there was correct syntax to use jQuery’s $().ready to check whether the DOM

  • 0

Is there was correct syntax to use jQuery’s $().ready to check whether the DOM is ready, rather than create a callback function once the DOM has loaded?

For example, I want to run different code if the DOM is ready.

function checkDOMReady() 
{
    if ($(document).ready)
        alert("The DOM was ready when this function was called");
    else
        alert("The DOM was NOT ready when this function was called");
}

Is this valid? If not is there a correct way of doing this?

EDIT:
I am well aware of $(document).ready(function(){}); and the like, but this is not what I am looking for. I have a script that runs every 10 minutes, including when the page is initially loaded, and I want to run different code if the document is ready, and other code if it is not. I could store this data in a global/static variable, but I would like to know whether it is possible simple evaluate a Boolean expression to check if the DOM can be manipulated.

  • 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-06-03T05:13:01+00:00Added an answer on June 3, 2026 at 5:13 am

    I don’t see why you’d want to do this. In any case, you can have a variable that is set in the document ready callback and check the variable.

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

Sidebar

Related Questions

Is there a correct way to use php from the command line...or rather...is one
I don't know the correct syntax to use if i wanted to check if
I need to create a multi-dimensional (nested) hashtable/dictionary so that I can use syntax
I've searched StackOverflow but still cannot understand the correct syntax to use Single, First
Is there a way I can use the 'bind' syntax for the 'toggle' event
So my syntax is apparently correct in all three cases (PostgreSQL isn't grousing about
Firstly I know that there are many question and solutions to correct thread marshalling
What do you think? Is this correct or are there memory leaks? Source: #include
There exists an RSS feed with over 1000 items. I want to create a
I have quick question about jQuery plugins, hope somebody out there has some advice.

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.