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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:35:16+00:00 2026-06-08T13:35:16+00:00

I have a WebMethod that is called by JavaScript to get data from a

  • 0

I have a WebMethod that is called by JavaScript to get data from a database. The database is off limits for this, so I can’t change anything there. I’d like to do this in JavaScript.

The string looks like this when it gets to the JavaScript:

"[{"id":"0", "value":"Avery Bradley"},{"id":"31", "value":"Jason "Jet" Terry"}]"

I’ve tried replacing ('\"', '\\\"') to add in an escape character. I got it to work on the .NET side that way Replace("\"", "\\\""). However, this is a self contained control that will be using it and that validation should be there.

What am I doing wrong?

function GetDataCallBack(childId, senderParam, senderValue, callback) {
var values;

$.ajax({
    type: "POST",
    async: false,
    url: callback,
    data: "{'id': '" + childId + "', 'parameter': '" + senderParam + "', 'value': '" + senderValue + "'}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (json) {
        values = json.d;
    }
});
return values;

}

  • 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-08T13:35:19+00:00Added an answer on June 8, 2026 at 1:35 pm

    The problem is on the server side. It’s serving invalid JSON. Specifically, this inside the last object in the array:

    "value":"Jason "Jet" Terry"
    

    Those quotes around "Jet" need to be escaped. The server is giving you invalid JSON.

    You can try to correct broken JSON, but it will be kludgy and likely imperfect.

    The server side needs to be fixed so that it serves valid JSON.

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

Sidebar

Related Questions

I have a .NET webmethod that I have called from jQuery. The method returns
I have a JSON response that is formatted from my C# WebMethod using the
We have a C# WebMethod that is called synchronously by a Delphi CGI (don't
I have a web method, which is called from jquery's ajax method, like this:
My webservice constructor is getting called each time that I call a webmethod. This
Ii have a web method that looks like this: [WebMethod] public int ImportData(System.Collections.Generic.List<Record> importRecords)
I have an asp.net WebMethod that returns an XmlDocument object. I can successfully call
Is it possible in jax-ws to have a webmethod that creates a new object
In C# I have methods that use [WebMethod(EnableSession = true)] I consume them in
i have an ASP.NET web service that returning a custom entity object (Staff): [WebMethod]

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.