json

JavaScript: Building a HTML table from a nested JSON

I have a problem building a HTML table from the following JSON [ { "size" : 167, "price" : 453400, "type" : "Neubau", "children" : false }, { "size" : 167, "price" : 453400, "type" : "Neubau", "children" : false }, { "size" : 167, "price" : 453400, "type" : "Neubau", ...

writing JSON with JSP

You would probably do this automatically with some library. But I am new with Java and JSON and I need a quick sollution. What I would like is to write down (echo) JSON out of a JSP file. So far so good, but now I have a list of objects. So I start a fast enumeration. And now the question: how do I close the JSON array with }] instead...

Regex to remove \" from a Groovy GString?

Hi, I'm trying to parse a JSON using Grails, to test the parser I Wrote an unit test and put my input JSON in a GString that looks something like this: """{"Information":"Some data here \"stuff\" some more.","AnswerToEverything":42,"Other":71,"Name":"Joe Doe"}""" The \"stuff\" is causing the parser to break. I tried using String.rep...

JqGrid is not filling with data

I have all the required javascript included, and the proper locale (at least, I think): <script type="text/javascript" src="http://localhost/Web/Scripts/jqgrid/js/jquery.jqGrid.min.js"&gt;&lt;/script&gt; <script type="text/javascript" src="http://localhost/Web/Scripts/jqgrid/js/i18n/grid.locale-en.js"&gt;&lt;/script&gt; Here's the j...

JSON "flat" serialization with Java

Hey guys, I am looking for a JSON library that supports defining the serialization depth. Ideally I would like a library that handles all primitive types and java.lang and the rest will be sent to a custom handler. In my case the custom handler should generate a Link object with URL and class of the element (for my REST API). Here an ...

json and jquery autocomplete - need help to understand what is wrong?

hello, i have this form: <form action="" method="get" style="margin-left: 2em"> <input id="companies" type="text" name="company" value="" size="40" /> <button type="submit" class="button-search">Search</button> </form> my json comes from this http://localhost:8080/;companies?name=aba and returns a valid json like: {"name":...

Encoding JSON in Mako?

Im having trouble with json in mako. I do this: ${ to_json( dict( a = 1, b = 2 ) ) } where to_json is: <%! import simplejson as json def to_json( d ): return json.dumps( d ) %> however, instead of giving me {"a": "1", "b": "2"} its giving me {&quot;a&quot;: 1, &quot;b&quot;: 2} so mako changes the " to " som...

JSON Schema Builder Program

Is there an existing program that helps forming a JSON Schema? ...

JAXB JSON force brackets on arrays

Hello, I'm trying to force brackets on lists that contain only one element. I want something like this: {"id":"0","industries":[{"id":"0","name":"Technologies"}],"name":"Google Inc."} But I get: {"id":"0","industries":{"id":"0","name":"Technologies"},"name":"Google Inc."} Here is my Entity: @Entity @XmlRootElement public class Compan...

pass function in json and execute

Is there any way that I can pass a function as a json string (conversion with JSON.stringify), send it to another function, parse the json and then execute the function that was in the json? I am using jquery and javascript. ...

Determine form input type from its ID returned in JSON columns

I'm returning data via JSON and attempting to loop through the JSON dataset to dynamically populate a form. I need to reference a particular field TYPE (select, text, checkbox etc) via that field's id attribute. The id attribute I'm matching against is coming through in the JSON columns. i.e. each column value in JSON corresponds to a fo...

C# Deserialization Json array without []

I'm really new too Json and I'm trying to call a Web Service. When the service return an array of one element de json string for this array is without the [ ]. This cause a Exception in the serializer I use. (I use this one http://james.newtonking.com/) My question is simple can I add something too tell to the deserializer to always ta...

JSON order mixed up

Hi, I've a problem trying to making my page printing out the JSONobject in the order i want. In my code, I entered this: JSONObject myObject = new JSONObject(); myObject.put("userid", "User 1"); myObject.put("amount", "24.23"); myObject.put("success", "NO")...

How to export (dump) WebSQL data

I'm working on a Chrome Extension that uses WebSQL to store historical data. Being WebSQL, the DB is stored on the client. I'd like to add an option to export/import such data so that the user can share/use this data with other users, or with other PCs. These are my first steps on a client-only database, so I wonder how to do this. I ...

How to identify the JSON response?

I am developing the REST enabled WCF Service. I am using the following code inside the interface. [OperationContract] //[WebGet] [WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)] List<String> GetProjects(); I want the method should return the JSON response. I am pass...

Screensaver for ubuntu that fetches online data?

Hi everyone, I got an idea last night. I have a PHP script at my web server that returns a XML or JSON array. What could I do to make a Ubuntu Screensaver to fetch this online data? ...

Test jsonp rest app response using httpbuilder

Hi I'm trying to build up a rest Service which provide JSON response. Yesterday i figured about what is JSONP, why to use it an so and so. Today i would like to make some test with my new version of my service. To test it, i use HTTPbuilder. But i can't get it working correctly. Here is the start of my test: def client = new RESTClient...

Parsing JSON to Java POJO's using GSON

I have a very straight forward issue here. I need to take JSON coming from the API and convert it to objects I created for them. This far, it will deserialize them into my List but each Metric object has null values JSON COMING IN { "metrics": [ { "metric": { "type": 1, "name": "slide-11-start", ...

XML vs YAML vs JSON

Assuming I'm starting a project from scratch, which is not dependent on any other project. I would like to use a format to store feeds, something like XML, since XML is not the only available format of its kind, I would like to know: why should I choose one over the rest? I will be using perl. 'Feed' is a description of a product (name...

Problem parsing following JSON with JSON Framework

I have the following json: { "response": { "status": 200 }, "user": { "flex_meta": { "layout": "[{\"windows\":[{\"type\":\"stream\",\"width\":260,\"x\":268,\"height\":763,\"y\":0,\"relatedDataObject\":{\"name\":\"watch\",\"id\":3190},\"arg\":\"watchlist:3190\"},{\"type\":\"rss\",\"width\":260,\"x...