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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:11:19+00:00 2026-06-04T13:11:19+00:00

According to jQuery load() method api: .load( url [, data] [, complete(responseText, textStatus, XMLHttpRequest)]

  • 0

According to jQuery load() method api:

.load( url [, data] [, complete(responseText, textStatus, XMLHttpRequest)] )
  1. 1st parameter is url
  2. 2nd parameter is map or string that is sent to the server
  3. 3rd parameter is callback function.

With the working example below

$('#result').load('ajax/test.html', function() {
  alert('Load was performed.');
});

it supplies arguments of ‘url’ and ‘callback function’, [data] argument is skipped.

Shouldn’t the example code treat the callback function as [data] argument (2nd parameter) ? Because of the order that parameters defined in the API . By following the API, 1st is url, 2nd is data, 3rd is callback.

I don’t get why the code would work. Very confused.

  • 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-04T13:11:21+00:00Added an answer on June 4, 2026 at 1:11 pm

    It is very clearly written in the jQuery source code.

    https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js

    Search for load: function( url, params, callback )

    It checks for the params (second parameter) and if it exist, It will call the isFunction method which internally check the type of the argument and return true if it is a function. The rest you know….

    enter image description here

    This is how isFunction looks like

    enter image description here

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

Sidebar

Related Questions

I've built a custom HTML5 audio player using jQUery according to the guide found
According to convention, I'm importing an initializing JavaScript file into my jQuery Mobile pages
I am using the jQuery accordion plugin to make an accordion of some data.
Problem I have a API V3 map, with a content window for each marker.
I am dynamically creating divs within a jquery accordion that are loaded with data
I recently asked a question (and had it answered) here: jQuery Load JSON I
I'm trying to use JQuery's $.getJSON to access Model data from the Controller, and
I am relatively new to using jQuery and would like to use the load
I have this weird issue that jquery.load sometimes fails on chrome. I'm not gonna
Hi I'm trying to implement jquery token input according to railscasts #258 http://railscasts.com/episodes/258-token-fields Where

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.