json

While running the JSON application,I got three errors?

I added it from existing files JSON folder and also added the framework and import the "JSON/JSON.h". After that while running apps, It is giving three errors that is no such files, they are #import "SBJSON.h" #import "NSObject+SBJSON.h" #import "NSString+SBJSON.h" When i select framework, Two of the files containing in it Headers a...

jSon objects count

I have a string st returned from a web service. I convert the string to an object, how can i count the no. of arrays inside it? (for this case its 2) var st = "{[{"Name": "fake", "Address": "add"]},[{"Name": "fake", "Address": "add"}]}"; var json = eval(st); json.length is always returning 1 ...

json to std::string in c++ from an URL.

Hello all, I want to implement something where I will get an URL which will be a link to JSON db, now I need to get the json from this URL and convert it to std:string in a c++ file. Is there any easy way to do this. ...

ASP.NET + JSON + C#.NET or VB.NET: Problem deserializing date time with JSON WCF WebService....

I'm getting datetime in JSON format as - "\/Date(1261413600000+0530)\/" From code behind, I'm using DataContractJsonSerializer.ReadObject method to deserialize data. Converted data time is not correct. How to parse correct JSON date time from code behind? ...

json character encoding problem

Hello! When I encode an array to JSON I get "u00e1" instead of á. How could I solve the character encoding? Thanks ...

Coercing Json Serializer into producing a particular datetime format (yyyy-mm-ddThh:mm:ss.msmsmsZ)

MyClass theSession = new MyClass() { accountId = 12345, timeStamp = DateTime.Now, userType = "theUserType" }; System.Web.Script.Serialization.JavaScriptSerializer Json = new System.Web.Script.Serialization.JavaScriptSerializer(); Response...

How do I create a random method name

I plan on using JSONP to call an external webservice to get around the fact that I dont want to create a global function that could potentially conflict with the calling page. I thought that creating a random function name and passing it up would work. Something like this: <script src="www.foo.com/b?cb=d357534"> where cb is the callb...

JSON | Django passing python list

Hi, I'm trying to send a Python list in to client side (encoded as JSON), this is the code snippet which I have written: array_to_js = [vld_id, vld_error, False] array_to_js[2] = True jsonValidateReturn = simplejson.dumps(array_to_js) return HttpResponse(jsonValidateReturn, mimetype='application/json') So my question is how to access...

Use class name as root key for JSON Jackson serialization

Suppose I have a pojo: public class MyPojo { int id; public int getId() { return this.id } public setId(int id) { this.id = id } public static void main(String[] args){ MyPojo mp = new MyPojo(); mp.setId(4); ObjectMapper mapper = new ObjectMapper(); mapper.getSerializationConfig().set(Serializat...

Problems using jQuery $.ajax to pass data

I'm using ASP.NET and attempting to call a method with a signature of [WebMethod] public static string GetInfo(string id){...} using the following javascript: var elementValue = $("#element").attr('id'); var d = "{id : " + elementValue + "}"; $.ajax({ type: "POST", url: "../WebPage.aspx/GetInfo", ...

Posting Static & Variable length data to the Server with JQUERY & Coldfusion

I'm looking to post the following type of data to a server using JQUERY & Coldfusion: foodID - int foodDESC - text html text from a WYSIWYG (CKEDITOR) --there will always be just 1 foodID and foodDESC per POST to the server but there can be a variable number of: locationID - int LocationDesc - text --There can be 0-8+ of these. Should...

How to create a JSON Object {"x":"16","y":"XXXX"}.... in JQUERY?

Given the following: What I would like to happen: 1. Find all Span TAGS with class="location" 2. Loop through these and create a JSON string to post to the server // Determine how many there are var postText = $("#container").html(); var numFound = $("span.location").length; var countVar = 0; //Loop through all the Locations $( "span....

HttpServletResponse XML to Java

I am maintaining this servlet that has a HttpServletResponse response that replies back to the client an XML message. I want to take the XML message and convert it to JSON, then send the JSON back. I want to avoid writing my own JSON converter if possible. Does anyone have a good method of doing this? I googled for this: http://pvoss.w...

jQuery, Quotes, characters etc are breaking my JSON

I'm using json2.js to create a JSON object which JQUERY posts to the Server. The object looks like: [{"locationID":"16","locationDesc":"XXXX"}, {"locationID":"111","locationDesc":"XXXX"}, {"locationID":"12","locationDesc":"XXXX"}, {"locationID":"11","locationDesc":"XXXX"}] Problem here is that XXXX sometimes contains quotes like "we'r...

Python | How to send a JSON response with name assign to it

How can I return an response (lets say an array) to the client with a name assign to it form a python script. echo '{"jsonValidateReturn":'.json_encode($arrayToJs).'}'; in this scenario it returns an array with the name(jsonValidateReturn) assign to it also this can be accessed by jsonValidateReturn[1],so I want to do the same using a...

Namespace Orginization and Conventions

So I have a little bit of a problem. I working on a project in C# using The StackOveflow API. You can send it a request like so: http://stackoverflow.com/users/rep/126196/2010-01-01/2010-03-13 And get back something like this JSON response: [{"PostUrl":"1167342", "PostTitle":"Are ref and out in C# the same a pointers in C++?", "...

Why can't I build this Javascript object?

I have an object I'm trying to populate from another object (that is, iterate over a return object to produce an object with only selected values from the original). My code looks like this: var collect = {}; function getHistoricalData(username){ $.getJSON("http://url/" + username + ".json?params", function(data){ ...

JSON feed to Java Object

Hi, I would like to know if there is a webpage/software that can "translate" a Json feed object to a Java object with attributes. For example : { 'firstName': 'John', 'lastName': 'Smith', 'address': { 'streetAddress': '21 2nd Street', 'city': 'New York' } ...

How might I escape Unicode characters in a JSON string using JavaScript?

JSON String: { "id":31896, "name":"Zickey attitude - McKinley, La Rosi\u00e8re, 21 ao\u00fbt 2006", ... } this causes an unterminated string in JavaScript. My attempt at a solution is: data.replace(/(\S)\1(\1)+/g, ''); or data.replace(/\\u([0-9A-Z])/, ''); any ideas/solution? Example: http://api.jamendo.com/get2/id...

How to stop ADO Data Service from sending 'MetaData' with the Data

I'm using MS Data Service to send JSON. (Using a View in the DB) Problem is that it sends "__metadata": { "uri":"ALL THE DATA REPEATED"} with the Data - each time. This doubles our Data over the wire each call. THERE MUST BE A WAY TO TURN THIS OFF!!! WHO KNOWS HOW? THX ...