json

problem with iterating through the JSON object

In the code below, I tried iterating over the JSON object string. However, I do not get the desired output. My output on the webpage looks something like:- +item.temperature++item.temperature++item.temperature++item.temperature+ The alert that outputs the temperature works well. The part where I try accessing the value by iterating thr...

return a list of string as JSONResult

how would I return a list of string in a json result in C# asp.net MVC? I have this controller public JsonResult AutoCompletePart(string id) { AutoCompleteService srv = new AutoCompleteService(); string[] parts = srv.AutoCompleteItemMaster(id); //how do i return parts as JSON? } Thanks ...

Anyone know how to initial a json import for jQuery.sheet?

I'm using the jQuery.sheet extension found at: http://www.visop-dev.com/jquerysheet.html Anyone have any experience with this plug in? Im trying to import a json file on page load. Following the demo I formatted my json output, but how do I load the output? I have my load function to: $('#sheet').sheet({ buildSheet: jQuery.sheet.m...

Is there any way to override or update Jersey's Jackson version?

We're trying to use Jackson 1.5 to take advantage of some of the polymorphic handling it offers, but it appears that Jersey brings along it's own outdated version of Jackson (1.1.1). When testing Jersey serialized JSON, we get different results than when we serialize by hand in unit tests. {"id":"40","ticketProps":[{"id":"28","field":{...

Getting started with JSON and the Yelp API.

I'm trying to use the Yelp API to get local restaurants depending on the user's latitude and longitude. The trouble is that I'm quite sure how to do this. Looking at the page that I need to retrieve the data from, it says that the type is text/plain. Can I use Ajax to do this or will I not be able to since it is a different domain? E...

javascript and json

I'm using javascript with a json library and running into a little trouble. Here's my json output: { "artist": { "username": "myname", "password": "password", "portfolioName": "My Portfolio", "birthday": "2010-07-12 17:24:36.104 EDT", "firstName": "John", "lastName": "Smith", ...

Using Json to Serialize/Deserialize TimeSpan

I'm trying to deserialize/serialize a timespan, but when the json is send it's set to 00:00:00 is this even possible to do? Thanks! -Kevin Btw, Language is C#, using Visual Studio 2008. ...

ASP.NET 3.0 and JSON from Web Services

Guys, I'm trying to hookup a ASMX web services in asp.net 3 to return JSON rather than XML. Anyone ever tried/wanted to do this? Thanks!! ...

iPhone Objective-C: combining methods together.

Hey everyone, I'm a complete noob at objective-C, so this might be a very silly question to a lot of you. Currently, I have a view with a 'SignIn' button, which when clicked, activates a sigupUp IBAction that I have defined below. Basically, this method needs to make a JSON call and get back some data about the user. So, right now, my...

ExtJS grid problem with html

I have an ExtJS grid connected to a store. When I add a thumbnail column with an <img> tag inside store, grid shows 0. Is there some kind of html filtering? If I change the store data to something without html tags it shows fine. Excuse my awful English and thanks in advance. ...

JSON Valid Chars

Is the presence of a \' within double quotes "invalid" in the context of a JSON response? Is there a definitive JSON spec that could give me an answer? ...

Associative arrays in javascript to JSON

I am using array as an associative array of objects in which keys are ID number of objects in database. Quiet naturally- IDs are large numbers - so that means it is common to have array of length 10^4 with only 20 elements as valid real objects. I want to send this data back to server but whatever plugins I had to convert js objects to...

JSON Self referencing loop explanation

Hi people. I am doing some work with C#, AJAX and JSON and am getting a Self referencing loop error. I am managing to get around this using the JsonIgnore attribute, but I was wondering if someone can give me a proper explanation as to what is actually happening here. Many thanks. Dave ...

disable character escaping in to_json / Hash.from_xml

I try to implement an api for a projekt and found this article http://www.coffeepowered.net/2009/02/16/powerful-easy-dry-multi-format-rest-apis-part-2/ So i get a xml.builder template to build my response and render it to json. It works great, but I have some utf-8 encoded Data I want to respond. First I specify the xml encoding. Next...

Key of radio-button into json view

Hi there, I am using the view_datasource module with drupal5 to get a json view. Now I have a cck-field with radio-boxes and want the key to be displayed in the json. However, it always displays the label. My allowed value list: http://dummyimage.com/960x240&amp;text=foo|&lt;img src="http://dummyimage.com/96x24&amp;text=foo"&gt; http:...

jQuery UI/Autocomplete - How to change default variable names?

jQuery UI Autocomplete uses the variable names "value", "id" and "label" to create the drop down list. For example: $("#cities").autocomplete({ source: "backend/cities.php", minLength: 2, select: function(event, ui) { city = ui.item.id; region = ui.item.label; country = ui.item.value; } }); the ...

RecursionLimit exceeded, while serializing in C#

Hi, Given I have the following classes, public class Foo { public string Name { get; set; } public IEnumerable<Bar> Bars { get; set; } } public class Bar { public int Amount { get; set; } public Foo Foo { get; set; } } public class BarItems { public string SomeString { get; set; } public IEnumerable<Bar> Bars ...

Should jQuery's parseJSON/getJSON methods be used?

I noticed that the jQuery parseJSON basically does a simple regex "check": parseJSON: function( data ) { if ( typeof data !== "string" || !data ) { return null; } // Make sure leading/trailing whitespace is removed (IE can't handle it) data = jQuery.trim( data ); // Make sure the incoming data is actual JSO...

JSON specialchars JSON php 5.2.13

I'm getting crazy over these encoding probs... I use json_decode and json_encode to store and retrieve data. What I did find out is, that json always needs utf-8. No problem there. I give json 'hellö' in utf-8, in my DB it looks like hellu00f6. Ok, codepoint. But when I use json_decode, it won't decode the codepoint back, so I still hav...

ExtJS Grid displays date column but not the other

Hello All, I've been having some trouble finding the problem in my code, so thought I'd try to find a second pair of eyes. Code: var logStore = new Ext.data.JsonStore({ autoLoad: true, url: 'inc/interface/config.php?list=messages', root: 'logs', id: 'ID', fields: ['ReceivedAt', 'Message'] }); var logGrid = new Ex...