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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:25:32+00:00 2026-05-30T00:25:32+00:00

I have a simple ajax call: $.ajax({ url: ‘http://localhost:39657/List/Receptacle’, dataType: json, success: function(json) {

  • 0

I have a simple ajax call:

$.ajax({
    url: 'http://localhost:39657/List/Receptacle',
    dataType: "json",
    success: function(json) { alert("success"); }
});

And in Fiddler, the entire response is:

HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Sat, 18 Feb 2012 07:39:11 GMT
X-AspNet-Version: 4.0.30319
Content-Length: 97
Cache-Control: private
Content-Type: application/json; charset=utf-8
Connection: Close

[{"Selected":false,"Text":"ABC","Value":"3"},{"Selected":false,"Text":"XYZ","Value":"4"}]

So it appears to have worked, but I get no alert…

What am I doing wrong here? Why is my JSON not parsing? Thank you.

  • 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-30T00:25:34+00:00Added an answer on May 30, 2026 at 12:25 am

    why you have '?callback=?' at the end of url ? is it jsonp? yes then change the dataType:'jsonp'

    Edit

    make a error handler

    $.ajax({
        url: 'localhost:39657/List/' + $(this).val(),
        dataType: "json",
        success: function(json) {
               alert("success");
        },
        error:function(xhr){
            console.log(xhr.responseText);
        }
    });
    

    see if it hits the success handler or the error handler and what error message does it give? i dont think there is something wrong with the json parsing as it is valid json and being parsed fine look here


    as infered from the comments you are running into the CORS blues, which is implemented as a security feature to prevent cross site scripting attacks
    you cannot use jsonp by just setting the dataType to jsonp on the client side, the server side has to be configured as well, if its a web-service you can set the response header to allow the cross domain resource sharing by

    var resp = new HttpResponseMessage();
    resp.Headers.Add("Access-Control-Allow-Origin","*");
    

    alternatively you can make a server side proxy and have that proxy call your other project whether its a webservice or web application and then return the received response to the client side

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

Sidebar

Related Questions

I have a simple ajax call: $.ajax({url: my_url_here, dataType: 'text', success: function(data, textStatus) {
I have a simple ajax call like this: $.ajax({ url: u, type: POST, dataType:
I have a fairly simple ajax call built on jQuery. It works perfectly in
I have this simple jQuery ajax post to a Pyramid webapp. Ajax call: $.ajax({
I have encountered a unique problem. I am doing a simple ajax call using
I have a simple web method and ajax call and continue to recieve an
i am just trying to make a simple ajax call to shorten a url
I have a simple ajax request that I am trying to call a web
I have a simple ajax call inside a javascript function to a php file,
I have a very simple ajax call to refresh some data on my webpage,

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.