Questions tagged [json]

JSON (JavaScript Object Notation) is a serializable data interchange format intended to be machine and human readable. Do not use this tag for native JavaScript objects or JavaScript object literals. Before you ask a question, validate your JSON using a JSON validator such as JSONLint (https://jsonlint.com).

Filter by
Sorted by
Tagged with
264votes
7answers
394kviews

How to extract and access data from JSON with PHP?

This is intended to be a general reference question and answer covering many of the never-ending "How do I access data in my JSON?" questions. It is here to handle the broad basics of decoding JSON in ...
user avatar
  • 24.5k
1241votes
36answers
2.1mviews

How to parse JSON in Java

I have the following JSON text. How can I parse it to get the values of pageName, pagePic, post_id, etc.? { "pageInfo": { "pageName": "abc", ...
user avatar
167votes
3answers
551kviews

How do I parse JSON in Android? [duplicate]

How do I parse a JSON feed in Android?
user avatar
  • 6,207
1734votes
16answers
2.0mviews

Parse JSON in JavaScript? [duplicate]

I want to parse a JSON string in JavaScript. The response is something like var response = '{"result":true,"count":1}'; How can I get the values result and count from this?
user avatar
1322votes
74answers
1.4mviews

How to compare arrays in JavaScript?

I'd like to compare two arrays... ideally, efficiently. Nothing fancy, just true if they are identical, and false if not. Not surprisingly, the comparison operator doesn't seem to work. var a1 = [1,2,...
user avatar
244votes
10answers
72kviews

What is the difference between JSON and Object Literal Notation?

Can someone tell me what is the main difference between a JavaScript object defined by using Object Literal Notation and JSON object? According to a JavaScript book it says this is an object defined ...
user avatar
2338votes
10answers
557kviews

What is JSONP, and why was it created?

I understand JSON, but not JSONP. Wikipedia's document on JSON is (was) the top search result for JSONP. It says this: JSONP or "JSON with padding" is a JSON extension wherein a prefix is specified ...
user avatar
  • 184k
465votes
16answers
948kviews

How can I parse a JSON file with PHP? [duplicate]

I tried to parse a JSON file using PHP. But I am stuck now. This is the content of my JSON file: { "John": { "status":"Wait" }, "Jennifer": {...
user avatar
  • 9,016
1717votes
59answers
1.1mviews

Convert form data to JavaScript object with jQuery

How do I convert all elements of my form to a JavaScript object? I'd like to have some way of automatically building a JavaScript object from my form, without having to loop over each element. I do ...
527votes
17answers
1.3mviews

How can I parse JSON with C#?

I have the following code: var user = (Dictionary<string, object>)serializer.DeserializeObject(responsecontent); The input in responsecontent is JSON, but it is not properly parsed into an ...
user avatar
1441votes
27answers
1.4mviews

Safely turning a JSON string into an object

Given a string of JSON data, how can I safely turn that string into a JavaScript object? Obviously I can do this unsafely with something like: var obj = eval("(" + json + ')'); but that leaves me ...
user avatar
129votes
9answers
222kviews

Serialize and Deserialize Json and Json Array in Unity

I have a list of items send from a PHP file to unity using WWW. The WWW.text looks like: [ { "playerId": "1", "playerLoc": "Powai" }, { "playerId": "2", "...
user avatar
  • 1,453
1112votes
30answers
956kviews

Deserialize JSON into C# dynamic object?

Is there a way to deserialize JSON content into a C# dynamic type? It would be nice to skip creating a bunch of classes in order to use the DataContractJsonSerializer.
user avatar
  • 15.6k
1122votes
41answers
1.4mviews

Parsing JSON with Unix tools

I'm trying to parse JSON returned from a curl request, like so: curl 'http://twitter.com/users/username.json' | sed -e 's/[{}]/''/g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; ...
user avatar
  • 12.5k
490votes
14answers
783kviews

jQuery AJAX cross domain

Here are two pages, test.php and testserver.php. test.php <script src="scripts/jq.js" type="text/javascript"></script> <script> $(function() { $.ajax({url:"testserver....
user avatar

15 30 50 per page
1
2 3 4 5
1897