json

How to describe JSON data in a spec?

What is the best way to describe JSON data in a spec? In the past I've used examples with 'wordy' descriptions, but it feels imprecise. There seems to be a nascent JSON schema standard, but it doesn't look like a hugely active project. Any other ways? (Update) After thinking about this for several days I like bmargulies suggestio...

jqGrid giving exception when json is attempted to be loaded

I have the following html in my site: <link type="text/css" href="/Styles/ui-lightness/jquery-ui-1.8.2.custom.css" rel="Stylesheet" /> <link type="text/css" href="/Styles/ui.jqgrid.css" rel="Stylesheet" /> <script type="text/javascript" src="/Scripts/jquery-1.4.2.min.js" ></script> <script type="text/javascript" src="/Scripts/jquery-ui-...

Parse simple JSON

Hi, I have a trouble to parse this piece of JSON { "00408C88A2E6": { "id": "00408C88A2E6", "name": "pippo"}, "00408C91188B": { "id": "00408C91188B", "name": "pluto" }, "00408C944B99": { "id": "00408C944B99", "name": "minni" }, "00408C944BA0": { "id": "00408C944BA0", "nam...

Getting a diff of two JSON strings using Java code

Can anybody suggest some Java Library or Code to get a diff of two JSON Strings? ...

Key Value Pairs in AS3

I have a back-end PHP script sending info to an as3 app. What I have it sending is Json info, what I did to make it a key value pair was stick a key and an equals sign in front of it, and send it off. It works on smaller values, but for some reason, it's not working with this, heres the code, I hope you guys can help. Thanks :) c3po=[{"...

List of Language Codes in YAML or JSON?

Is there a list of language codes in YAML or JSON somewhere out there? Another format is fine, I can convert it if necessary. ...

$.getJSON inside client side custom validation

hey guys I got ASP.NET MVC 2 running and I'd like to check for the existence of a client (basically a front-end user) via validation. To do that server side is obviously pretty easy, but I have some trouble getting it to work client side, since I somehow have to wait for the callback function inside the function which gets returned by t...

$.getJSON from jQuery (in Rails app) not reading JSON from cross-domain Node.js/Express app / jsonp?

From googling/forums I think there could be two issues, neither of which I know how to fix: 1) I need to do something with the jsonp callback in the node.js request (which was generated automatically by jquery b/c of the callback=? param) - either add it to the header (where? and how?) or add it to the json response (again, where? and h...

Generic JSON object

I have a generic JSON structure I want to put in to a JavaScript object. My JSON is like this { "rows": [ { "items": [ { "key": "foo1", "value": "bar1" } , { "key": "foo2", "value": "bar2" } ] } ...

Question about JSON

If I console.log(result); I get {"MSG":"WRONG","QUESTIONID":182.0} But If I console.log(result.QUESTIONID); I get undefined What am I doing wrong? ...

Loading values into an HTML select using jQuery/Json

I am trying to load values into a select dynamically using values from a json string. The data is being loaded correctly, but for some reason, only the 1st value is loading into the select. Can anyone spot why this could be? Here is my JSON data: [{"cat_id":"1","cat_section":"pages","cat_type":"cat","cat_name":"Music","cat_order":"1",...

How do I pass the this element to the result of getJSON?

I want to do the following... $('.showcomments').click(function() { $(this).parent().hide(); jQuery.getJSON('comments.json',function($data) { $(this).parent().append($data['value']) //this is meant to be the instance of //$('.showcomments') that has be...

need direction regarding jquery and json

Hi, I have this url which is JSON webservice http://ws.geonames.org/weatherJSON?north=90&amp;south=-9.9&amp;east=-22.4&amp;west=55.2 I need to write a jquery function to access the JSON object from the above url. I am not sure how to proceed with this task. Could someone help me out with starting out the jquery code? Thanks Inorde...

What is an elegant way to create application access URLs for an existing web application?

I've been assigned to create an RESTful Android application for an existing web service which is built using Django. My current design idea is to have the Android application receive a JSON version of the data that would normally be sent to the Django template on each url. So my view would look like: #The site stores and organizes user...

How to convert a Ruby object to JSON?

Say I would like to do something like this, is it possible? require 'json' class Person attr_accessor :fname, :lname end p = Person.new p.fname = "Mike" p.lname = "Smith" p.to_json ...

use Attr tags for json?

I have this question and i am wondering if a possible solution can be adding attribute tags to say the object[][] maps to MyType[] where element 1 is MyType.IntName and element 2 is MyType.HtmlSz Is it possible in any json solution on .NET? ...

Parse string to JSON

Hi, I'm parsing this JSON string with the libs in org.json and I can't understand why I get the output below into the log. ArrayList<String> al = new ArrayList<String>(); JSONObject demo = new JSONObject("{\"00408C88A2E6\":{\"id\":\"00408C88A2E6\",\"name\":\"Lab\"},\"00408C91188B\":{\"id\":\"00408C91188B\",\"name\":\"Lab1\"},\"00408C944...

Help with JSON in rails

My back end is my Rails server which sends JSON data to my front end. In the front end, I am using javascript and jQuery which processes my JSON data and displays some of it. Now, the user can inputs a number depending on the data displayed to it. So, on the basis of input from user, certain changes are made to JSON data received earlier...

getting updated receipent and email body information from MFMailComposeViewController class

Hi friends, Is it possible to get updated receipent and email body information from MFMailComposeViewController in iphone sdk manually. And manually sending that data in json web service to my own mail box. Regards, sathish ...

How to order a JSON object by two keys?

I have a JSON object that I want to sort by one key first, then by a second key similar to ordering by two columns in SQL. Here is a sample of the JSON I would have: { "GROUPID":3169675, "LASTNAME":"Chantry" } I would like to order all the results by the GROUPID and then by LASTNAME. I've used the JSON sort function to sort by one ke...