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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:49:50+00:00 2026-05-27T14:49:50+00:00

Say I add to First.js: $(document).ready( function () { dosomething A }); function ()

  • 0

Say I add to First.js:

$(document).ready(

function () {
    dosomething A
    });

function () {
    dosomething C
    });
});

and to Second.js:

$(document).ready(

function () {
    dosomething B
    });
});

will all 3 functions be executed after DOM is ready?

What will be the case when I register

to First.js:

$(document).ready(
A = function () {
    dosomething A
    });

C = function () {
    dosomething C
    });
});

to Second.js:

$(document).ready(
A = function () {
    dosomething A
    });

});

The later will override the first?

TIA

  • 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-27T14:49:51+00:00Added an answer on May 27, 2026 at 2:49 pm

    Your first example is invalid syntax. It will cause the javascript interpreter to throw an exception. You need to pass one and only one function to $(document).ready(fn). You can include multiple function calls inside the one function, but you can only pass one function to .ready().

    Your second example is also a syntax error – an extra });. If that is removed, it will work and execute that one function.

    Your third example in both first.js and second.js is also a syntax error. You can’t put arbitrary javascript as the parameter to .ready(). It must be one function reference with proper syntax.

    Now, what you may have been trying to ask if you actually provided legal syntax in your examples is that all functions you pass to .ready(fn) will be executed when the document is ready. jQuery keeps an array of all functions that have been passed and executes them all when the document becomes ready. The jQuery documentation for .ready() does not specify the calling order if .ready() has been called multiple times with multiple functions, though one could examine the source code and see what the order is likely to be.

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

Sidebar

Related Questions

Say I add a function to an outstanding Interface. In Visual Studio, within a
How do I add let's say something like ajax=1 to all links on my
I want to add items in a LaTeX-document. Say for example, that I want
First of all, I do know about the Fisher-Yates shuffle. But lets say for
Say I create one object and add it to my ArrayList . If I
Let's say we have a service to add a new hotel: > POST /hotel
Let's say I have defined a route: routes.Add(new Route(Users/{id}, new MvcRouteHandler()) { Defaults =
Let's say I have a site where Users can add Entries through admin panel.
Let's say I've got: Dim los1 as New List(Of String) los1.Add(Some value) Dim los2
I'm trying to add two folders to my eclipse project's classpath, let's say Folder

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.