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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:42:34+00:00 2026-06-06T00:42:34+00:00

I have a web service that returns this string via the jQuery $.ajax() call

  • 0

I have a web service that returns this string via the jQuery $.ajax() call in the success callback:

[{"WaitlistID":1,"RID":45034,"CustomerID":2765957,
 "IsAdmin":false,"TruckSize":1,"Points":1},
 {"WaitlistID":2,"RID":45034,"CustomerID":2765957,
 "IsAdmin":false,"TruckSize":1,"Points":1}]

Unfortunately if I call $.each() on that value in the success callback it iterates over every letter in it, and doesn’t treat it as a two element array, which is what I’d like. I’ve tried the makeArray() function but haven’t had any luck, how can I convert that string into a JSON object array?

edit:

In response to the comments (thanks, everyone) I already do set the dataType to ‘json’, which is odd. Here’s the code in question.

jQuery.ajax({
    type: "POST",
    url: pagePath + "/" + fn,
    contentType: "application/json; charset=utf-8",
    data: paramList,
    dataType: "json",
    success: successFn,
    error: errorFn
});

..so I’m not sure why it didn’t work originally, but the parseJSON() bit did the trick. Appreciate everyone’s help.

  • 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-06T00:42:37+00:00Added an answer on June 6, 2026 at 12:42 am

    You can use jQuery.parseJSON to parse it:

    var obj = $.parseJSON(str);
    

    However, jQuery should already do this for you if the server returns the correct content-type. If it is not, you can specify jQuery to treat the response as JSON:

    $.get("test.php", function(data){
       // callback
    }, "json");
    

    Or even better, use jQuery.getJSON.

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

Sidebar

Related Questions

I have a WCF Ajax enabled web service that I call via jquery. It
I have a third party web service that returns this xml <book> <release_date>0000-00-00</release_date> </book>
I have a synchronous web service call that returns a message. I need to
I have a web service that returns an xml string as results. The return
I have a web service that returns the binary array of an object. Is
I'm dealing with times formats in Restkit, I have a web service that returns
I have a WSE web service that returns a list of items in a
I have a Web Service with Just one Web Method that returns a boolean
I have a web service that returns a simple object: [System.CodeDom.Compiler.GeneratedCodeAttribute(System.Xml, 2.0.50727.4927)] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
I have a web service that returns a dataset object that contains the current

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.