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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:20:15+00:00 2026-05-18T05:20:15+00:00

I am trying to both create the Server and client side of a jsonp

  • 0

I am trying to both create the Server and client side of a jsonp request, and I cannot seem to make it work. I’ve looked around at numerous guides, blog posts, etc, but pretty much everyone shows only the client side.

Here’s my client code

$.ajax({
    dataType: 'application/json',
    data: params,
    jsonp: 'jsonpCallback',
    url: settings.domain + '/httpext.dll?json_cc',
    success: function (data) {
        //determine the return status
    },
    error: function (response, status, error) {
        //error handling
    }
}); //end ajax

right now, the server is returning a hard coded value like this

jsonpCallback({"username":"meltingice","posts"1234});

My problem is that I cannot get the request and response to work together. Currently, the response is returning application/json, so if I change my request ro expect jsonp it errors with

Resource interpreted as script but transferred with MIME type application/json.
Uncaught ReferenceError: jsonpCallback is not defined

First off, as you can see, I have jsonpCallback defined.

Now, if I change the dataType to application/json, then I get this error

XMLHttpRequest cannot load http://myserver/httpext.dll?json_cc&sid=adsfhasjdkfhajksdghjk%3Basdhg&action=SALE&ccCard=&ccNum=&ccExMM=0&ccExYYYY=0&ccCVV2=&holdersName=&totalDue=0&dueDate=11%2F19%2F2010. Origin http://localhost:59905 is not allowed by Access-Control-Allow-Origin.

As you can see, it is not putting callback=? into the url. It’s rather frustrating.

How do I set up the server side so I can call it using jsonp? What do I need for the response type? How do I format the data returned so my client side code can pull back the data?

  • 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-18T05:20:16+00:00Added an answer on May 18, 2026 at 5:20 am

    The reason this doesn’t work is because your server is always returning a hardcoded method name and your client is using an anonymous success handler. This cannot work. You need to configure your server to use the method name passed as argument or it will never invoke the success callback at the client. So once you configure your server to take into account the jsoncallback query parameter you could test it like this:

    $.getJSON(settings.domain + '/httpext.dll?json_cc&jsoncallback=?', params, function(result) {
        alert('success');
    });
    

    Now the server will receive a request that might look like this:

    http://foo.com/httpext.dll?json_cc&jsoncallback=jsonp1290183992345
    

    and it should respond like this:

    jsonp1290183992345({"username":"meltingice","posts"1234});
    

    with proper Content-Type as well obviously (application/json).

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

Sidebar

Related Questions

I am trying to run client server UDP program . My both machines are
I'm trying to create a feature that both creates a list template and an
I'm trying to create an overridden operator function using both const parameters, but I
I'm trying to copy both an image from a file and text from a
I am trying to generate equivalent MD5 hashes in both JavaScript and .Net. Not
I'm trying to build a page on my personal website that both used jQuery
I am seeing both of them used in this script I am trying to
I've been lately trying to learn more and generally test Java's serialization for both
I'm new to both ASP.Net MVC and jQuery and what I'm trying to do
I'm trying to map a ManyToMany relationships between 2 tables, both having composite primary

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.