json

Ajax: Building HTML vs injecting HTML

Trying to comply with StackOverflow's suggestion of asking a question, not creating a discussion, let us consider these two methods that use the HTTPAsyncRquest to update a web page without refreshing it: 1) Data returned by AsyncRequest is parsed/interpreted in order to build the resulting HTML that updates the page e.g. JSON::parseAn...

How to send a hashtable to an asmx webservice?

I'm trying to send a hashtable to my webservice using JSON. However, you can't send a dictionary-type object (for some reason). A solution that apparently works is "List(Of KeyValuePair(Of String, String))", as output anyway: <WebMethod()> _ Public Function test() As List(Of KeyValuePair(Of String, String)) Dim ret As New List(Of K...

Accessing Nested Objects in Json

I have a custom object which contains other items (ie arrays, strings, other types of objects). I am not sure how to traverse the object to iterate and list all of the object types, keys, and values of the nested items. Second to this issue I don't know how many levels of nesting there are (as the object is generated dynamically from t...

How do i do this in Linq?

Hi folks, i've got an IList<Foo> and I'm trying to serialize it as Json without the field names included in the result. As such, i'm trying to create an anonymous object, which i pass to the Json serialization method. Foo is defined as (pseudo code):- public class Foo { public int X; public int Y; } When i return this as Jso...

Is it possible to hide columns in jQuery Grid by default?

I have been working with the jQuery Grid the past few days and one thing I have not found any documentation on yet is the ability to hide a column by default. The reason I want this is that I'm building my JSON w/ every property of my object yet my grid might only show 75% of these as valid columns. I want the ability to pass back more...

Storing strings and integers in a single GWT array

It seems like this should be relatively simple, but apparently not so much. I can't figure out for the life of me how to store strings and integers in an array in GWT. What data type do you use? If I use JsArrayString, it throws an IllegalArgumentException when retrieving an index containing a number. I obviously can't use JsArrayInt...

Beginner JavaScript: Working with JSON and Objects in JavaScript

I have some JSON returned to the browser like this "product": { "Title": "School Bag", "Image": "/images/school-bag.jpg" } I want this data to be a "Product" object so I can use prototype methods like a toHTMLImage() that returns a HTML image representation of the product: function Product() { } Product.prototype.toHTMLImage = functi...

JSON viewer for Linux

Can anyone recommend a good JSON viewer (or even editor) for Linux? ...

The AJAX response: Data (JSON, XML) or HTML snippet?

I'm just wondering what is an "ideal" output format for the AJAX response? Pure data (JSON, XML) rendered into the page using some client-side JavaScript template engine? Or an HTML snippet rendered into the page "as-is"? What is your preference and why? ...

Streaming Parsers (JSON/XML) for AS3/Flex/Adobe AIR application

Are there any stream-reading, parsing libraries available for json or xml formats in AS3? I'm setting up a long-polling application, using URLStream/URLRequest. I do not have control over the data I'm receiving other than a choice between formats. I'd like to have a parser that can handle fragments at a time, which would allow me to t...

Ruby-like array arguments implementation in PHP

I program in PHP mostrly and Ruby sometimes I happen to be in need of a way to implements those "hash arguments" into my PHP funcions (Like, say, an HTML select helper) draw_select :name => :id, :onclick => 'alert(this.value)' The problem in PHP is that I would have to define an argument order to implement many possible attributes. I...

Why have "while(1);" in XmlHttpRequest response?

I'm playing firebug with Google Calendar. I happens to find that some XHR request has response like below: while(1);[['us','bW9yZ2FuLmNoZW5nbW9AZ21haWwuY29t 20090320/20090904 63378122163']] It looks like a JSON with prefix dead-loop javascript statements. I'm not sure why Google Calendar has such kind of XHR response. Is there any kn...

how to pass complex queries in rest???

If I understand correctly, in rest style, every query (that is, every action on every resource that does not modifies the resource's state) should be enconded in the querystring, using a get method, with no body at all... am I right? well, I have several applications that comunicate with the db thru an xml message that is handled by a ...

Dynamically reading resources from a file

I've been using resx files for static strings in order to have a central place for changing them. The problem is that I can't change them after the project is built and deployed. There are some strings that I would like to change after deployment, without restarting the process (so .config files are out). It's possible to write code th...

json and php settings

I am passing a json encoded string from javascript to a php file on the server via ajax. on my online server this works fine. but locally, it does not. There are a few differences in the php installs in the 2 places. minor ones. both are php4. the install locally is actually a newer php4. I'm trying to track down why this is happening....

WCF: Use JSON to encode a SOAP Message Body

We have SOAP implementations of our services and up till now we had some legacy code that was wrapping our args and returns in another object to get around some serialization / generics on RPC methods. After optimization, we had implemented this class so that it Json serialized (DataContractJsonSerializer) and GZipped our complex reques...

Parse JSON reponse from Google Maps page

I'm trying to find the best way of parsing the response from a "normal" (i.e. not using the API) Google Maps page in my java code. Reason: I want to submit a query string requesting a listing (be it hotels, restaurants etc.) and then parse the JSON that comes back. I had looked into using the Google Maps API, but it doesn't seem to cov...

How to create a JSON view from a domain object?

I'm creating the server side implementation of an AJAX based web application, where the client side receives responses that are domain objects serialized as JSON. In order to provide a common look and feel, I would like to create templates for different types of domain objects, and re-use these as Spring views for multiple controllers. ...

can't get jquery output my json object

I have the following code in my page. I am expecting a series of json objects to get returned from the person_output.aspx page, which it does successfully. However, when it comes to outputting the content, I receive an error. $.getJSON("ajax/person_output.aspx", { 'uID': 1 }, function(data) { $.each(data.items, function(i...

json sorting question

I have a very simple json object like the following: ({ "people": [ { "f_name": "john", "l_name": "doe", "sequence": "0", "title" : "president", "url" : "google.com", "color" : "333333", }, { "f_name": "michael", "l_name": "goodyear", "sequence": "0", "title" : "general manager", "url" : "google.com", "color" : "333333", }] }) Of cour...