json

Sending data remotely from iPhone native apps to Rails apps

Dear all, I have decided to develop a native iPhone apps as a compliment to our webapps. Now I am wondering what are my options to send data remotely from the iPhone apps - since the database is online - to our online database. What I can think of on top of my head - since I come from web dev background - is JSON. My webapps is built us...

Is it possible to encapsulate multiple-lines of html or javascript inside Json format ?

Any example on the net ? ...

Serialize an object using DataContractJsonSerializer as a json array

I have a class which contains a list of items. I want to serialize an instance of this class to json using the DataContractJsonSerializer as a json array. eg. class MyClass { List<MyItem> _items; } class MyItem { public string Name {get;set;} public string Description {get;set;} } When serialized to json it should be like...

Jquery JQGrid breaks when contentType=application/json?

I've had to use $.ajaxSetup() to globally change the contentType to application/json $.ajaxSetup({ contentType: "application/json; charset=utf-8" }); (See this question for why I had to use application/json http://stackoverflow.com/questions/2792603/aspnet-mvc-why-is-modelstate-isvalid-false-the-x-field-is-required-when-that) But t...

How do I parse JSON from a Java HTTPResponse?

I have an HttpResponse object for a web request I just made. The response is in the JSON format, so I need to parse it. I can do it in an absurdly complex way, but it seems like there must be a better way. Is this really the best I can do? HttpResponse response; // some response object Reader in = new BufferedReader( n...

how to code client-side call to webservice that calls automatically every few seconds

I have a webservice that I want to call from the browser every few seconds to see if there are any notification messages in the database that should be displayed on the screen. We have the JSON code working to display the messages in a JavaScript function after an Async Postback, but this only executes after a page turn. I want it to exe...

Best and simple way to handle JSON in Django

Hi, As part of the application we are developing (with android client and Django server) a json object which contains user name and pass word is sent to server from android client as follows HttpPost post = new HttpPost(URL); /*Adding key value pairs */ json.put("username", un); json.put("password", pwd); StringEntity se = new Str...

What is wrong in this JSON string?

My JSON string looks like this, [{"id" : "38","heading" : "Can you also figure out how to get me back the 10 hours I sp.....","description" : "Im having a very similar problem with the Login control - again it always generates a default style containing border-collapse - only in this case .....","img_url" : "~/Event...

How to decode JSON (varying number of elements, varying keys) using Jquery

My JSON looks like this: { "[email protected]":"Person1", "[email protected]":"Person65", "[email protected]":"Person24" } It's returned in various number of elements, and various keys. How do I traverse the data if my code is like this: $.post("includes/ajax.php", { group_id : $('#group').val() }, function(data) { //how d...

Reporting sanitized user input to the user via AJAX

I am writing some code to give live feedback to the user on the validation of a form using AJAX. I have got it checking length and if the field is empty. Now I want it to sanitize the users input and if the sanatized input differs from the users original input then tell them which characters are not allowed. The code I have written so f...

JSON jQuery displaying parsed data problem

I have a function $.post('php/client.login.php', {username:username, password:password}, function(json){ var ids = json; alert(json.id); }, 'json'); Which returns undefined, the json data i am trying to read is this [{"id":"8","client":"sam","email":"sam","username":"sam","password":"sam","ca...

cant get ajax response (JSON) to call 'success' function?

for some reason the success function isnt being called? javscript: $.ajax({ type: 'POST', url: 'http://localhost/hf_latest_desktop/st_pages/user_area/acc_buttons/pass_change/pass_change_ajax.php', data: data, dataType: 'json', success: function(e){ console.l...

Define and send a JSON object array

I'm looking for a way to define and send a JSON object array. I've figured out how to define a single JSON object, turn it into a string and send it, but what about an array of this type? Probably something simple I'm overlooking... var myColumnSetting = { "ColumnName": name, "ColumnIndex": index ...

Send html array as post variable using Request.JSON

I have an html: First name: <input type='text' name='first_name' value='' /><br/> Last name: <input type='text' name='last_name' value='' /><br/> <input type='checkbox' name='category[]' value='Math' /> Math<br/> <input type='checkbox' name='category[]' value='Science' /> Science<br/> <input type='checkbox' name='category[]' value='Hist...

Automate Access of Alpha Numerical index in json

Hi, I have following kind of index while accessing json data using jquery data.rows[0].student_1 data.rows[0].student_2 data.rows[0].student_3 and so on... Now, i want to automate this thing in a loop like for(var i=1;i<length;i++) { // so that i can access all student records i.e. student_1, student_2 and so on data.rows[0].stud...

Openlayers - LayerRedraw() / Feature rotation / Linestring coords

TLDR: I have an Openlayers map with a layer called 'track' I want to remove track and add track back in. Or figure out how to plot a triangle based off one set of coords & a heading(see below). I have an image 'imageFeature' on a layer that rotates on load to the direction being set. I want it to update this rotation that is set in 's...

Addin to Visual Studio for visualizing a selected json string in the editor

Hi! I've got a lot of xml files, and embedded in some elements there are json serialized objects. They are quite difficult to read and modify. So question is: Are there any Visual Studio addins availible that can take selected json-text in the editor, and visualize it (and maybe even allow for editing)? if not, if I must build it - ar...

Why boost property tree write_json saves everything as string? Is it possible to change that?

I'm trying to serialize using boost property tree write_json, it saves everything as strings, it's not that data are wrong, but I need to cast them explicitly every time and I want to use them somewhere else. (like in python or other C++ json (non boost) library) here is some sample code and what I get depending on locale: boost::prope...

Parsing a JSON feed from YQL using jQuery

I am using YQL's query.multi to grab multiple feeds so I can parse a single JSON feed with jQuery and reduce the number of connections I'm making. In order to parse a single feed, I need to be able to check the type of result (photo, item, entry, etc) so I can pull out items in specific ways. Because of the way the items are nested withi...

How to mysql Update table field with JSON data from Serialized data field??

Hi there, Here's my situation: - a table with a varchar field in which i store serialized data from php now I have to add another field to the mysql table in which i store JSON data also from php As the table already has serialized data stored i was wondering if i can unserialize > json_encode and store the data in the new db field?...