Black_Trash
asked on
JSON parse a string from web service jQuery
Hi,
How would you parse the following JSON string that is being returned from a web service using jQuery?
Part of the string = {"NewDataSet":{"Inventory" :[{"MOVE_I D":....
Set a variable that would contain the value of MOVE_ID.
Thanks,
Keith
How would you parse the following JSON string that is being returned from a web service using jQuery?
Part of the string = {"NewDataSet":{"Inventory"
Set a variable that would contain the value of MOVE_ID.
Thanks,
Keith
Hi,
If you are familiar with LINQ, you may want to have a look at LINQ-TO-JSON:
http://james.newtonking.com/projects/json/help/index.html?topic=html/LINQtoJSON.htm
Giannis
If you are familiar with LINQ, you may want to have a look at LINQ-TO-JSON:
http://james.newtonking.com/projects/json/help/index.html?topic=html/LINQtoJSON.htm
Giannis
How are you calling the webservice - from JQuery?
If so, if you are using $.post or $.ajax then you have an option in these functions of having JQuery automatically parse the json for you ex
If so, if you are using $.post or $.ajax then you have an option in these functions of having JQuery automatically parse the json for you ex
var moveid;
$.post(url, data, function(response) {
// use parsed JSON response here
moveid = response. ... .MOVE_ID; // Fill in missing path as needed
},'json');
@jyparask it is altready in JSON
@julianH yes he is and the "Fill in missing path" is the actual question
@julianH yes he is and the "Fill in missing path" is the actual question
I didn't say it is not a JSON.
LINQ-TO-JSON is a mean of parsing the JSON using the power of LINQ. Of course this would need server side processing, so i don't know if this is acceptable here. But if it is, i find it really useful.
Giannis
LINQ-TO-JSON is a mean of parsing the JSON using the power of LINQ. Of course this would need server side processing, so i don't know if this is acceptable here. But if it is, i find it really useful.
Giannis
@julianH yes he is and the "Fill in missing path" is the actual questionI don't agree - question asks how to parse JSON response and only a part of the response is given.
To properly answer your interpretation of the question would require the poster post the entire JSON response - not just part of it.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Sorry, thought I had already posted an accept on the solution
Thanks,
Keith Black
Thanks,
Keith Black
http://www.jsoneditoronline.org/
and you will see
Open in new window
so you will have
Open in new window