When loading JSON use the jQuery .promise(), like so: var object = {}; $.ajax({ url: ‘someURL.php/someparam’ sucess: function(data){ $.each(data, function(key, […]
Tag: json
Parsing json responses the lazy (as in I-hate-if’s) way
(Yes, I don’t know how to name the tip). Suppose you have an API call that might answer a json/js […]
Import events into calendar JSON format
Coding Problem : I want to import events from a non-private, server-side Google Calendar (PHP) into JSON format. Since I […]
JSON pretty-print bash alias
JSON pretty-print bash alias (nifty little snippet): alias pp=’python -mjson.tool’ Example: ~$ echo ‘{“test”: “whoa!”}’ | pp { “test”: “whoa!” […]
How to display multiple values of a JSON in PHP
Coding Problem : How can I display all the values of a JSON in PHP ?? I’ll give you an […]
Handle CSV data in JavaScript
CSV to array of JS Objects I am working with large datasets of lat/lng coordinates and am given the data […]
Pretty print JSON from command line with NodeJS
Inspired by this protip: Commandline JSON Pretty Print everywhere. I was pretty sure it can be done in less code […]
Format json output
Usage some-not-formated-json-string | python -mjson.tool Exemple Creation of a json.php script which outputs a JSON string: <?php $a = array( […]
Parse XML into associative array (with CDATA-Support)
Several days ago I tried to parse an XML file into an associative array. With the use of implexml_load_file or […]
How to download CSV and JSON files in React
This article was originally published on The Road To Enterprise blog. Read it there for the best reading experience. There […]
Pass array through POST method
How to pass an array using POST method. First use the function json_encode() to encode the array. Then use htmlspecialchars() […]
POST JSON data to PHP
My friend discuss about why AngularJS send POST to PHP but it can’t using $_POST to receive data. I find […]
Prettify JSON in the command line
echo ‘{ “foo” : 42, “bar” : “baz” }’ | python -m json.tool This is a big help when wanting […]
JSON for PHP via AJAX
Coding Problem : I really need some help .. I have a select with the products: <!– panel preview –> […]
Format JSON within vim
If you work a lot with web services, like myself, the you will find this infinitely helpful when working with […]
Failed to compare dates before writing to bank
Coding Problem : I’m trying to do a date validation, if the date DataInicial is less than DataAtual , ie […]
Clean JSON Preview
JSON feeds are great. Except when they aren’t. You know, those feeds with thousands of nodes, nested (seemingly) infinitely, and […]
Don’t forget to accept args when writing to_json methods
When writing custom to_json methods on your ruby objects, don’t forget that you need to accept arguments. The following will […]
pretty format json file in vim
open json file in vim <escape>:%!python -mjson.tool ?? profit!
PHP ExtJS Types Builder
The ExtJS-Types-Builder is a OOP-PHP-Framework and creates JSON suitable strings for the communication with your ExtJS-GUI. Due an fluent interface […]