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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:21:20+00:00 2026-06-07T02:21:20+00:00

I need to order some onReady calls, I was looking at these questions here

  • 0

I need to order some onReady calls, I was looking at these questions here and here and found nothing. However it was quite long time ago, and maybe now there is something to workaround this.
so I need to do something like this:

$(function (){ console.log('second call'); })
$(function (){ console.log('first call'); })

To clarify why i need to do this:

The reason why I need that is these calls are spread through all the application, and what the most important: some of them are from third party and I cannot control them. But I do need to call my methods at first place, and i need to place scripts at the very and of the document. The code I working on is the legacy code and I cannot change it a lot, so answers like reconsider the way you are doing it would make no much sense for me. I just wandering if it possible or any workaround.

  • 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-07T02:21:21+00:00Added an answer on June 7, 2026 at 2:21 am

    You could use an array to store the functions and have one onReady call that invokes them in the right order.

    var calls = [];
    
    calls[2] = function() {
        console.log("third call");
    };
    
    calls[1] = function() {
        console.log("second call");
    };
    
    calls[0] = function() {
        console.log("first call");
    };
    
    $(function() {
        for (var index = 0; index < calls.length; index += 1) {
            calls[index]();
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to set some varaibles i need the information if a given file
I need some advice on which Swing Components to choose in order to achieve
In some of my tests i need to check the order of Lists and
I need to spoof the IP source address of some packets in order to
I have some things in my app that I need to store, in order
I'm in need of some basic TSQL help. Here's my table layout: Orders Table
The below shown is my query I need to order by with these three
i need to order some data in the following way DTO{ id //nullable name
I need some help with sending email when an order is placed. To illustrate
I have some folders and files inside a directory. I need to order only

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.