All Questions

621
votes
28answers
929005 views

How to parse JSON

I have the following JSON text that I need to parse to get pageName, pagePic, post_id, etc. What is the required code? { "pageInfo": { "pageName": "abc", "pagePic": "http://exam...
99
votes
2answers
130056 views

How do I extract 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...
1400
votes
16answers
1658947 views

Parse JSON in JavaScript?

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?
51
votes
4answers
368489 views

How to parse JSON in Android

Where can I find step-by-step instructions on how to parse a JSON feed in Android? I'm just an Android beginner wanting to learn.
1699
votes
7answers
370645 views

What is JSONP all about?

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 specifie...
1337
votes
49answers
801867 views

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 ...
401
votes
13answers
580089 views

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.p...
522
votes
37answers
425636 views

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...
256
votes
14answers
495804 views

How can I parse a JSON file with PHP?

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": { "status":"Active" }, ...
682
votes
21answers
435013 views

Deserialize JSON into C# dynamic object?

Is there a way to deserialize JSON content into a C# 4 dynamic type? It would be nice to skip creating a bunch of classes in order to use the DataContractJsonSerializer.

Previous Next