json

in c#, how do i convert this data structure into Json

In C# i have an array of Calendar objects each Calendar object has an array of CalendarEvent objects each CalendarEvent object has a Date and Name property i want to convert this to Json object but i want to change the data structure a bit so in the json object a calendar is an array of dates and an array of names (breakdown the Calen...

ebay api buying item through iphone sdk

I want to give facility of buying items from ebay but I am not getting which ebay api i have to use for buying with iphone sdk? ...

how to convert xml to json using jquery

$.get('data/animals.xml', function(xml){ var animals = $.xml2json(xml); alert(animals.dog[1].name +'/'+ animals.dog[1]); }); the code below runs very well for http://www.fyneworks.com/jquery/xml-to-json/data/animals.xml but how can get rate data from http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml according to code block...

How to create a WCF reply service for AJAX unit testing

Dear all I want to create a WCF service that will simply reply back the query string, HTTP headers, and the HTTP verb used in a request it received. I want to use it to unittest a AJAX enabled JavaScript framework I am building so I can verify that the HTTP headers and HTTP verbs are being set correctly. Basically I need a way to make...

Dealing with hash in PHP json object

I have a json object that follows the following structure: $foo->bar['1']->#foobar The hash is causing it to fail, how do I get the value of #foobar? Thanks ...

Jquery Autocomplete JSON response

Hi All, I am trying to use the JqueryUI autocomplete plugin but I am unable to make it work. I am using Spring MVC at the backend and I am returning JSON response by following this http://loianegroner.com/2010/02/spring-mvc-and-ajax-with-json/ post that I got from the net. My problem is, there seem to be some problem in the way the au...

Passing variable to callback after Ajax request

Is there a more elegant way of passing a variable after performing an Ajax request (JS->PHP) other than printing the results? Printing can get a little messy and also doesn't offer a lot of flexibility in terms of the return value (e.g. hard to pass objects). Also, I had this random space that was printed in one of my Ajax request cal...

Can you convert C# dictionary to Javascript associative array using asp.net mvc Json()

I recently asked this question, but after some of the responses and some research, i wanted to change what i was actually asking. i have seen a number of blog posts about sending associative arrays from javascript to C# controller action but i want the opposite. I want to return json to a client as a dictionary (from my research the ja...

How do you get the number of keys in a JSON object?

Hey everyone, I am creating a gallery plug-in in which I need to figure out the number of elements in a plain javascript object. The following is how I would like to be able to create the gallery. $.Gallery.create($('#galContainer'), { 'img1.png': 'http://linktosomewhere/', 'img2.png': 'http://linktosomewhere/', 'img3.png':...

.NET Append JSON to a string already serialized with DataContractJsonSerializer

I am using DataContractJsonSerializer to serialize an object to json, and then returning to the client with AJAX. I now need to serialize another object to return along with it. The problem is MSs "d" that wraps around the JSON, that stops me from simply concatenating the strings into a single JSON string. json = json & """,""SecurityGr...

How to pass JSON to webpage on load of page?

Hi I have a ASP.NET MVC 1.0 app. I have a listbox on the page and I want to pass an array to the webpage so that javascript can use the array to do some processing depending on the item picked in the listbox. So I thought the best way is to pass JSON data to the webpage on load. So what is the best practice on how to do this? Can y...

Calling simple web service (.asmx file) from AJAX and JQuery using JSON - parse error

Hi all, Making my first steps in trying to use all these technologies together.. I'm having some toubles.. Here is my Server side: [WebMethod(EnableSession = true)] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string simplestMethod() { return "Simplest method returned"; } And here is my client side: $(document).rea...

remove quotes from keys in a json string using jquery...

Consider this as my json string, {"Table" : [{"userid" : "11","name" : "KumarP","designation" : "Business Head", "phone" : "9789234793","email" : "[email protected]","role" : "Admin", "empId" : "EI003","reportingto" : "KumarP"}]} and i want to have my string like this, {Table:[{ userid: "11", name: "KumarP", designation: "Bus...

calling Json data returns undefined "

When I call json object from php file it returns undefined. I can see all data writing alert(data) but when I write alert(data.books) it returns undifined. $JSON = ' { "books": { "book1": "firstbook", "book2": "secondbook" } } '; and I call it with jquery jQuery('#login').live('submit',function(event) { $.ajax({ u...

Appending/creating/removing items from a javascript array, ideas??

Hi, I have a requirement whereby I have two panes on a page, the pane on the left holds a series of records specific to a option selected from a drop down. Each record has a plus sign next to it, if this is pressed it will be 'moved' to the right hand pane and displayed under the option the user selected. Multiple records can be put i...

What can I use instead of a loop in Jquery

I have two dropdown box. 1st box having list of values. When I click add button the selected value from dropdown1 shift to dropdown2. Then when I click "add all" button all the values from list will shift from dropdown1 to dropdown2 through jQuery. Here I am having problem. After add the values from box1 to box2 when I click submit butt...

json official java api : JSONArray of JSONObjects

Salaam, Using json.org API, we can easily convert a map to a JSON object : Map<String, String> carta = new Map<String, String>(); carta.put( "id", "123"); carta.put( "Planet", "Earth"); carta.put( "Status", "getting dirty"); JSONObject json = new JSONObject(); for(Iterator<String> it=input.keySet().iterator(); it.hasNext();){...

How do I return unnamed JSON string array from asp.net mvc2 json result?

I have the following code: var json = MyObject .Select(p => new { id = p.MyObjectId, name = p.MyObjectName }); return Json(new { json }, JsonRequestBehavior.AllowGet); This returns a JSON object as follows: { json: [ { id: 1, name: "Bob" }, { id: 2, name: "Fred" }, { id: 3, name: "James" } ] } However, ...

Is There A List Of JSON Feeds?

Anyone have a list of sites or applications that publish their feed as a public JSON file? ...

Going Back after connectionDidFinishLoading

Hello, I have a question, (Basically same as this one which remained UN-answered I'm writing some methods that call a JSON API, and receive a response, each method will create an HTTPRequest, but the data received will not be available in the method, but will be available in connectionDidFinishLoading. How can i use the data now? I h...