json

Parsing and generating JSON

Mathematica's list of built-in formats is pretty extensive; however, JSON is not on that list. Is there an existing solution for generating and parsing JSON in Mathematica, or are we going to have to roll our own solution? ...

Efficient JSON encoding for data that may be binary, but is often text

I need to send a JSON packet across the wire with the contents of an arbitrary file. This may be a binary file (like a ZIP file), but most often it will be plain ASCII text. I'm currently using base64 encoding, which handles all files, but it increases the size of the data significantly - even if the file is ASCII to begin with. Is ther...

Struts 2 and @SMD Method validation

Hi, i am using Struts 2 and the Json plugin, to make ajax requests. I want to know if there's one way to validate my json, with struts validator, and show field errors in my jsp, before calling the @SMDMethod in my Action. Thanks for your help. ...

parsing JSON in java ?

How to parsing JSON in java? { "code": 100, "message": "SUCCESS", "result": { "list": [ { "cardNumber": "ALUFZZ5SZ1Q5", "expireTime": 1270742400, "surplusThreshold": 4, "uid": 771292, "useTime": 1270214375, "wa...

How to loop a json array and update links

Hello, On page load, I do one call to get the current status of all the favourite links (display the right message aka: click to subscribe, click to unsubscribe. Final Code! :) Thanks for your help guys, please check post revisions to see the issue. $(InitFavorite); function InitFavorite(){ var jList = $(".favourite_link"); ...

Choosing between JSON and XML

Previously I used XML soap for data exchange in my web services, But switched to json for another project. Now I cant seem to find a reason to go back to XML, primarily because of the response size difference for large objects. In what case would you need to use XML over json for web service response? ...

JSON-RPC and Json-rpc service discovery specifications

Hello, I'm going to implement JSON-PRC web service. I need specifications for this. So far I had found only one resource that can be called as real specifications: JSON-RPC 1.0 http://json-rpc.org/wiki/specification Proposal of JSON-PRC 2.0: http://groups.google.com/group/json-rpc/web/json-rpc-2-0 (why is it on google groups?) Howev...

How to populate a dropdownlist with json data in jquery?

I am developing a country state cascading dropdown list... I returned json result based on countryId but i dont know how to populate/fill it in a new dropdown listbox... Here is what i am using, function getstate(countryId) { $.ajax({ type: "POST", url: "Reg_Form.aspx/Getstates", data: "{'countryId':" + (cou...

SBJSON error statment

I have one issue i have some error (SBJSON Undeclared) Please help in this issue ...

YUI DataTable with JSON and client side filtering Data Error

Hi, I don't understand what I'm doing wrong here ! I keep getting a Data Error. But I validated the JSON and it's ok... Here is the javascript from the YUI Datatble example (slightly modified). <pre class="prettyprint"><code> <script type="text/javascript"> YAHOO.util.Event.addListener(window, "load", function() { //var Ex = YA...

json-simple API

Hello Is there a javadoc for json-simple? I am trying to make a JSONObject from an existing map among other calls and this trial by casting is getting too much, grin. thx. ...

Read JSON (text file) into .NET application

I have a configuration file in the following JSON format: { "key1": "value1", "key2": "value2", "key3": false, "key4": 10, } The user can set/unset the configuration values using a text editor. I however need to read it in my C# application. Whats the best way to do so for JSON? The above keys are not associated with...

I want to input JSONObject from jquery.post() to a a simple JS chart(bar chart)?

HI I am very new to both json and js charts. In the example of bar chart, they are giving a hard coded array like this, var myData = new Array(['U.S.A.', 69.5], ['Canada', 2.8], ['Japan & SE.Asia', 5.6] ); var myChart = new JSChart('graph', 'bar'); myChart.setDataArray(myData); Instead of that I want to use the response of $.post() m...

Get nested/hierarchical JSON from MySQL/PHP

I am using spacetree chart and I require JSON in hierarchical format. See sample required JSON format here. I have ID,ParentID,Name,Description fields in Mysql database table. Now How can I convert data in Hierarchical/nested JSON using PHP? I know json_encode($array). But, I require nested/Hierarchical php array for this. Let me know t...

JSON is not being recognised

Hi All, Im having a bit of trouble getting my JSON to be recognised by my web page. I have validated JSON that im getting returned from server, so i know that is correct, however my javascript function is not doing anything with it. My succes function is as follows: success: function(data) { $('input[name=customer_name]').val(data.n...

Passing JSON through the URI

I'm trying to create a REST based web service with data encapsulated using JSON. My problem is when I pass the string version of JSON in the URI it turns to something like this: %7B%22coal%22:100,%22ele%22:1500.1%7D. I'm wondering if there are any functions Java for converting between the escaped and unescaped versions so I can parse th...

input field to put javascript/json and security issues.

I want to let visitors of my web pages to access a textarea where they can write a tiny bit of javascript to configure certain features. Imagine the javascript to be something like this: { max:100; allowFeedback:false; filterEnabled:true ; } I would want to eval what they write and then my javascript would do something dep...

Sending a JSON object to an ASP.NET web service using JQUERY ajax function

I want to create object on the client side of aspx page. And i want to add functions to these javascript classes to make easier the life. Actually i can get and use the objects (derived from the server side classes) which returns from the services. When i wanted to send objects from the client by jquery ajax methods, i couldn't do it :...

JSON Response {"d":"128.00"} but displaying "128"

Hi all, I have been working on a shopping cart that the user can add/remove order items as they please and am returning an updated sub-total via a webservice using jQuery $.ajax Here is how I am calling the webservice and setting the sub-total with the response. //perform the ajax call $.ajax({ url: p, data: '{' + s + '}', ...

how to use ajax with json in ruby on rails

I am implemeting a facebook application in rails using facebooker plugin, therefore it is very important to use this architecture if i want to update multiple DOM in my page. if my code works in a regular rails application it would work in my facebook application. i am trying to use ajax to let the user know that the comment was sent, ...