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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:10:13+00:00 2026-06-14T08:10:13+00:00

I can’t understand the doc of the jQuery.ajax, specifically two options: jsonp and jsonpCallback

  • 0

I can’t understand the doc of the jQuery.ajax, specifically two options: jsonp and jsonpCallback, so can somebody be so pleasant to explain?

What I do understand is that jsonp is a name of a GET parameter which server expects (usually ‘callback’) and jsonpCallback is a name of a function to wrap a response. Seems simple.

But the explanation at the jQuery.ajax doc makes this a bit complicated. I would like to cite the complete text for jsonp option here and mark with bold what is obscure to me:

jsonp

Override the callback function name in a jsonp request. This value
will be used instead of ‘callback’ in the ‘callback=?’ part of the
query string in the url. So {jsonp:’onJSONPLoad’} would result in
‘onJSONPLoad=?’ passed to the server. As of jQuery 1.5, setting the
jsonp option to false prevents jQuery from adding the “?callback”
string to the URL or attempting to use “=?” for transformation. In
this case, you should also explicitly set the jsonpCallback setting.
For example, { jsonp: false, jsonpCallback: “callbackName” }

So the questions are:

1.What does it mean “=?” or ‘callback=?’ (extra question mark)? When I perform a JSONP AJAX-request like here:

 $.ajax('http://fake.com',{
     dataType: 'jsonp',
     success: function(data) {console.log(data);}
 }); 

The URL looks like this, there is no such question mark:

http://fake.com/?callback=jQuery18104830878316494931_1352981996209&_=1352981999411

2.What is the extra parameter (underscore) _=1352981999411?

3.What do the words In this case, you should also explicitly set the jsonpCallback setting mean? I can’t see any interrelationship. If I set { jsonp: false, jsonpCallback: "callbackName" }, as it is said in the doc the query will look like this:

http://fake.com/?_=1352981999411

There is no use of the “callbackName” at all so why to specify it?

My appreciation.

  • 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-14T08:10:14+00:00Added an answer on June 14, 2026 at 8:10 am

    The callback name is optional, if you don’t supply one it uses a default one. Hence, if you leave out onJsonLoad you just get callback.

    What happens is the JSON is wrapped with a function, because JSONP works through the <script> tag, so your normal JSON:

    {prop: value}
    

    Becomes:

    callback({prop: value});
    

    When the script tag is loaded jQuery can then call this function and get back the JSON data.

    The _=123456788 is just a Date.getTime() to stop the request from caching.

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

Sidebar

Related Questions

Can somebody point me to a resource that explains how to go about having
Can someone thoroughly explain the last line of the following code: def myMethod(self): #
Can anyone explain to me why this program: for(float i = -1; i <
I have a jquery bug and I've been looking for hours now, I can't
Can I call select before recv_from on a socket that is blocking?
Can I have a project that has some parts written in c and other
Can some one confirm me that only one UIWindow instance is possible in any
Can we change the color of the divider? Apple documentations says, that we can
Can someone please explain why this doesn't work? MyClass myClass1 = new MyClass(); object
Can anyone explain me what's going on? I use this method - (BOOL)shouldAutorotateToInterfaceOrientation:( UIInterfaceOrientation)interfaceOrientation

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.