All Questions

673
votes
29answers
1003922 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...
118
votes
2answers
148272 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...
1446
votes
16answers
1699403 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
383187 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.
1749
votes
7answers
384695 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...
1379
votes
49answers
830640 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 ...
566
votes
42answers
464476 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...
411
votes
13answers
597248 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...
270
votes
14answers
524545 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" }, ...
165
votes
7answers
48667 views

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 define...

Previous Next