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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:07:26+00:00 2026-06-17T06:07:26+00:00

In many example code I saw the format of .getJSON() is something like $.getJSON(url?jsoncallback=?,

  • 0

In many example code I saw the format of .getJSON() is something like

$.getJSON("url?jsoncallback=?", function(data){
...}

And at back-end the response is written like

$response = $_GET["jsoncallback"]."(".json_encode($orders).")";
echo $reponse

I delete “?jsoncallback=?” from the url and $_GET[“jsoncallback”] and square brackets at back-end and it seems that everything still works. So what is the use of that jsoncallback stuff indeed?

  • 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-17T06:07:27+00:00Added an answer on June 17, 2026 at 6:07 am

    If you don’t have the jsoncallback=? it will just do normal JSON request not JSONP*. You can do normal JSON request just fine on your own server or a server that sends CORS headers.


    * forget about JSONP, this is a fancy name for inserting a script element in your document that runs code from a foreign server but with same authorization as your own scripts. The $_GET["jsoncallback"], makes it a javascript function call like this:

    fn({"data": "value"});
    

    This is the code in a script like <script src="http://foreign.org/data?jsoncallback=fn"></script>. As you can see, that’s Javascript, not JSON. With this, foreign.org (or someone hacking them) can change their script to do anything with authorization on your page, so be careful when using “JSONP” and prefer CORS JSON.

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

Sidebar

Related Questions

My webserver is hosting many apps whose path looks like http://example.com/app1/ http://example.com/app2/ ... I
I saw an example of using the function: delete in cpp and I didn't
I am new to URL rewriting and saw in many sites the effect of
i saw many example of Fluent style api development but some time i saw
I'm running some 3d example code from oracle in Eclipse, but I get many
I'm new to Java. I saw many example about reading XML and when I
I know this question will be closed because I studied many example of this
I'm a iOS Application developer.I need some similar tasks in many projects as example
For example, many methods in frameworks/JDK might throw java.lang.SecurityException but this is not indicated
For example I have an app that counts how many time Camera button was

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.