json

Deserializing json array into .net class

I'm having problems deserializing some json data, getting InvalidCastExceptions and the like. Can anyone point me in the right direction? Here's the json i'm wanting to deserialize; [{"OrderId":0,"Name":"Summary","MaxLen":"200"},{"OrderId":1,"Name":"Details","MaxLen":"0"}] Here's my code; Public Class jsTextArea Public O...

Activesupport::JSON.decode crashes on this,

I wonder why i cant decode this json string, all what i want is to convert this to a proper Ruby hash, anyone have an idea? i think the array of objects is cracking it ? Parameters: {"{\"origins\":"=>{"{\"origin\":\"this\"},{\"origin\":\"dont\"},{\"origin\":\"dont me please\"},{\"origin\":\"and me please\"},{\"origin\":\"dont\"},{\...

call jQuery JSON function and pass back resulting payload

I would like to call jQuery JSON function and pass back results as JSON object (Javascript array?), but I am not quite understanding dynamics of what is happening here. myJSON = myFunction(productNo) $.each(myJSON, function(i,user){ alert (user.description) } function myFunction(productNo) { $.getJSON ( "processors/proces...

Parsing JSON using C?

There are several C libraries available for parsing JSON, that will compile on Linux. Which library would you recommend? ...

JSON Spawning mysql sleep processes.

I am in the process of making a Javascript(Front end, PHP back end) game. In this game it checks the server for updates every 2 seconds. There is one 1 sql call being run and at the end I use $mysqli->close() to close the SQL connection. The columns in the where are both indexed. The problem I am having is after its running for a l...

JQuery.ajax works on every platform except IE

I have a simple ajax call that works correctly on EVERY other platform except IE. It work on my mac, Ubuntu, Windows Chrome, Windows Firefox, but NOT IE var params = "action=tsll_field_request&tsll_action=login&email=foo"; $.ajax( { type: "POST", url: ajaxurl, data: params, dataType: "json", error:function(xhr, statu...

JSON stringify missing from jQuery 1.4.1?

Apparently jQuery has the ability to decode a given object or string into a JSON object. However, I have a JS object that I need to POST back to the server and I find no utility in jQuery that wraps the JSON.stringify() function. That function is found in Chrome, Safari 4, FF3.6, and IE8 but is not found in earlier browsers. I can use it...

getJSON: why does the 1 example work, but the other not?

I have 2 examples of a function that retrieves json-data and gives an alert. In this example, everything goes fine: http://jsbin.com/uwupa3/edit $(document).ready(function(){ var timeService = "http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?"; $.getJSON(timeService...

Jquery $.ajax() call to webmethod

Hi, I have never before used the $.ajax() and if you see any mistypes let me know ;) Im using jQuery $.ajax() to call a webmethod with JSON. The simple definition of the webmethod should look something like this: [WebMethod] public static bool MyMethod(string a, string b, string c) { ... } The value for the data parameter in $.a...

iPhone Objective-C JSON Parser

Has anyone had issues with a size limit on a returned JSON Object using the JSON Parser that is available for the iPhone? Here is a link to the JSON framework I am using: http://code.google.com/p/json-framework/downloads/list (I am using the latest version) If I reduce the size of the returned JSON my app will run just fine. If the ob...

json Object access properties problem

Hi all, i've a problem with json object (created from java Object1) that contains a List of Object2... i cannot access to the value of the object2 in the list og object1.. the json Object is { "object": { "idItemGroup": "45", "path": "1", "dealer": "6", "refIdMacroItemGroup": "6", "descrip...

ASP.NET 3.5 Ajax JSON Serialization...

I have a website that works perfectly under built-for specification but with the increased use of SIM card dongles I’ve (I won’t be the first to be pulling his hair out over this) encountered a site-killing issue... (ok ok ok... a days’ work perhaps) When the mobile provider gets a request for a file it's passed through a very clever ap...

Javascript data binding and SEO

I have an application that makes a series of WCF calls that return JSON via JSONP. In turn javascript code will then bind that returned data to HTML controls. When a bot / spider hits my application, no data would be indexed because javascript would not execute in the bot. What are some good patterns for dealing with this problem? Id...

Ordering the rows of a database table

I have a table feeds that contains a collection of code-description rows. e.g. Key | Value | Url fb | facebook | http://www.facebook.com tw | twitter | http://twitter.com ff | friendfeed | http://friendfeed.com A REST endpoint returns the contents of this table as a JSON array & it is displayed ...

Problem creating JSON with JsonGroovyBuilder in Groovy

I am new to JSON and Groovy. I can make an AJAX call to a groovlet and make it build some HTML codes with MarkupBuilder. Along with the HTML string being returned, I want a JSON string to be filled in one of a input text box. The problem is the use of JsonGroovyBuilder(). I can't even get the simplest example shown in Json-lib to run...

asp.net mvc, jquery flot, and json problem

Hi, i'm trying to learn how to use flot and i think your example is a very nice, simple, very understandable code so i've been trying to implement it but... well, here is my code in the index.aspx: $(function () { $.getJSON("../../Home/JsonValues", function (data) { alert('json: ' + data + ' ...'); var plotarea = $("...

Encode object to JSON

Hi, Hoping I don't have to reinvent the wheel here but does anyone know if there is a class in c# similar to the one supplied by Adobe for AS3 to convert a generic object to a JSON string. For example, when I encode an array of objects. new JSONEncoder(arr).getString(); output: [{"type":"mobile","number":"02-8988-5566"},{"type":"mobil...

JSON as HTML data in Flex - Hyperlink Rollovers

I am using JSON to parse HTML data with customized html tags in Flex. Flex's support for HTML is pretty minimal, so I am wondering if it's possible to do a simple font color change rollover effect on these links. Currently I have found that Flex only supports a few HTML tags, but also supports CSS through Flex's whack CSS methods. C...

How do you dynamically access attributes of a JSON Object

I have a two level JSON object EX: var regexDefs = { "alpha": { "regex" : /^[A-Z]+$/, "errMsg" : "Alpha Only" } } I want to do something akin to searching an array for a key. (using jQuery's inArray) var key = "alpha"; alert($.inArray(key,regexDefs)); if the key is in the array then I want to ...

Can I pass a JSON object from Silverlight to javascript

I know I can call javascript and pass string values from Silverlight, but can I pass a JSON object or does it have to be serialized? ...