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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:38:12+00:00 2026-05-24T00:38:12+00:00

For example, I have var menu_ready = false; . I have an ajax function

  • 0

For example, I have var menu_ready = false;. I have an ajax function that sets menu_ready to true when the ajax stuff is done:

//set up event listener here

$(...).load(..., function() {
    ...
    menu_ready = true;
}

How do I set up an event listener that waits for menu_ready to be true?

  • 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-24T00:38:14+00:00Added an answer on May 24, 2026 at 12:38 am

    WARNING My answer below is from a period slightly prior to the sailing of the Mayflower. It’s a bad answer. I can’t remove it because it was accepted, and the system won’t let me remove an accepted answer. I could edit it to make it better, but why do that when others have given solid answers below? Bottom line: scroll past this to a more fulfilling life. 🙂

    <BAD-ANSWER>
    

    One way is continual polling:

    function checkMenu() {
        if (!menu_ready) {
            setTimeout("checkMenu();", 1000);
            return;
        } else {
            // menu_ready is true, so do what you need to do here.
        }
    }
    

    and…

    <body onload="checkMenu();">
    
    </BAD-ANSWER>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that submits a jQuery .ajax event every time menu's value
I have an website with URL`s like example.com/index.php?p=home An this script $(document).ready(function() { var
Say for example I have the following string: var testString = Hello, world; And
I was just wondering when you have for example: var dir = new DirectoryInfo(@C:\Temp);
Let's have an example: using (var someObject = new SomeObject()) { var someOtherObject =
I have the following array as3 example: var arrayDefinitionsargsAmfPhp:Array = new Array(); arrayDefinitionsargsAmfPhp['tabela'] =
I have an extjs component in its raw object type, for example: var x
I have a semi-working example that you can look at. This appears to work
I have /var/www/cool_codebase on www.example.com AND I have /var/www/cool_codebase on www.example.net The codebases are
I have a problem with the jQuery detach() function. See the Example page .

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.