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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:06:20+00:00 2026-05-11T20:06:20+00:00

I got acquainted with jQuery a few days back and am beginning to realize

  • 0

I got acquainted with jQuery a few days back and am beginning to realize the little magic it can do.

I am curious to know how exactly a callback with arguments is executed in jQuery i.e. what is the exact execution sequence?

I went through the link http://docs.jquery.com/Tutorials:How_jQuery_Works

and it speaks of a wrong way i.e.

$.get('myhtmlpage.html', myCallBack(param1, param2));

and a right way i.e.

$.get('myhtmlpage.html', function(){
  myCallBack(param1, param2);
});

In the first case, myCallBack would be executed first and then its return value would act as an argument to get. In the latter method, get would return a web page which would be acted upon by the myCallBack.

How does it work as syntactically both have myCallBack as being still an argument to get? I’m a bit confused on this.

cheers

  • 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-11T20:06:20+00:00Added an answer on May 11, 2026 at 8:06 pm

    This is indeed quite a vague example. You should write:

    $.get('myhtmlpage.html', function(param1, param2){
      myCallBack(param1, param2);
    });
    

    That is because internally jQuery does something like this(very simplified):

    $.get = function(url, callback){
      //make call to url
      //when completed execute callback:
      callback(param1, param2);
    }
    

    You could also write:

    $.get('myhtmlpage.html', myCallBack);
    

    That will also call myCallBack with the two parameters.

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

Sidebar

Related Questions

got a new blog at wordpress few days ago ( http://ghads.wordpress.com ) and I
got a little problem im hoping someone can enlighten me on. Trying to serialise
i've got a (probably very simple) problem with jquery. I'm running a Java Servlet
Got issue My javascript array contains dates for ex. 19.4.2003,28.11.1997,3.1,,29.6,7.11.2008 (date-month-year). As you can
I installed and got acquainted with Mylyn today. I also watched the excellent Mylyn/Tasktop
Got a problem with jquery. I cant get a .xml file from the server,
Got a real simple question but can't figure out the solution. Got following code.
got a decent setup working with jwplayer and the playlists. One thing i can't
got another little provlem with flex ... i've made a ellipse and i want
I have programmed a bit of C++ back about 14 years ago. I got

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.