json

WCF service - OperationContract - string array

I'm building WCF service where one OperationContact should consume string array on input. The POST request is build from jQuery with $.toJSON function and looks like {"user":"77cae724-d5b3-412d-9499-2cfc175bf66f", "data1":["ba3be5f2-c65d-4c21-86b1-829cad246746","604c53b1-1e24-42f7-8aba-93314eb0878e"], "data2":"d15c3cf6-02c8-42f2-97...

export canvas data to json

Hay guys, i've made a simple drawing application using the canvas tag. However i would like to export the data to JSON so it can be saved. How does one go about this? ...

How can I make JsonResult return an array of arrays (without field names) rather than an array of objects?

I have an IEnumerable list of date/value pairs that I am returning as a Json list to flot. However, when I call JsonResult(), the result looks like this: [{"Date":date1, "Value":value1}, {"Date":date2, "Value":value2}...] Flot is expecting [[date1, value1], [date2, value2]...] Is there any simple way to get the MVC framework to out...

jQuery / Programmatically Select an Option in Select Box

Hello, I'm currently using jQuery to return some JSON results. Once these results are returned, I'm using them to pre-populate fields in my form. However, I need some help in pre-selecting items in a drop down box. For example, I have a select box (this is shortened): <select id="startTime"> <option value="14:00:00">2:00 pm</option...

What is the way to manage errors and return JSON?

I have a php application, that, when it encounters an error, will run a function that uses trigger_error() as well as uses the following function to return the error as JSON. $this->returnError('My error'); In some places in the script, multiple errors occur, but only one gets returned, because the returnError() function will stop th...

Invalid JSON parsing using PHP

I'm pulling a JSON feed that is invalid JSON. It's missing quotes entirely. I've tried a few things, like explode() and str_replace(), to get the string looking a little bit more like valid JSON, but with an associate JSON string inside, it generally gets screwed up. Here's an example: id:43015,name:'John Doe',level:15,systems:[{t:6,gl...

json technology attached with java script? what is the use of stringifier in it?

How do we use arrays and object notation in it ? Well how do we post , is JSon a platform dependent or independent language? ...

Json "Parser Error" from server to client.

Hi, I use an asp (classic) utility file to create json objects from an SQL database, see: http://code.google.com/p/aspjson/ here is what I get from the server side: {"results":[{"Opt_Name":"BARR","Opt_FirstName":"TomTest","Comp_Name":"My_Company"}]} Which is valid json, at least valid for jsonlint. BUT this never triggers my callba...

Any particular advantage to using json over xml with Flash

Well is there? From everything I've read, it seems like the answer is no,but was wondering if anybody has a differing opinion. ...

PHP Always run function

I am trying to get some errors returned in JSON format. So, I made a class level var: public $errors = Array(); So, lower down in the script, different functions might return an error, and add their error to the $errors array. But, I have to use return; in some places to stop the script after an error occurs. So, when I do that, ...

JSON: why are forward slashes escaped?

The reason for this "escapes" me. JSON escapes the forward slash, so a hash {a: "a/b/c"} is serialized as {"a":"a\/b\/c"} instead of {"a":"a/b/c"}. Why? ...

Which Json deserializer renders IList<T> collections?

I'm trying to deserialize json to an object model where the collections are represented as IList<T> types. The actual deserializing is here: JavaScriptSerializer serializer = new JavaScriptSerializer(); return serializer.Deserialize<IList<Contact>>( (new StreamReader(General.GetEmbeddedFile("Contacts.json")).ReadToEnd())); Befor...

add dynamic controls and get its values using jquery

I need to add dynamic controls and get its values in my asp.net mvc (C#) application using jquery. On click of button, i need to add specific dynamic controls, enter the values and pass its values on clicking submit button using jquery. For ex.: In Create Event of Google Calendar, we can add multiple options for reminder. Like that i n...

How do I convert a JSON object to an array for use in jQuery?

I'm building a price estimator form, which uses jQuery to manipulate select menus. Basically, when a new quantity is chosen, the value of each option in every select menu is multiplied by a per-unit price, and a new price is shown to the user. What I'm trying to do is pull the per-unit prices from a PHP file, which stores these prices i...

List of relevant RPC Protocols

I need to evaluate and dig more into the use of Remote Procedure Call Protocols (over the network) and haven't found a comprehensive list of which I could include. There are some I already know from experience like RMI "RESTful style RPCs" XML-RPC SOAP JSON-RPC (CORBA ?) GWT-RPC and other Vendor specific ones, commonly used But I'm...

Does jQuery have built in full support for JSON2 ?

I need to know is JSON2 lib included in jQuery core or must i use JSON2 lib from http://www.json.org/js.html. ...

to_json (rails ) similar function for ASP.NET MVC / .NET

Hi, In rails you can do the following to convert an object to Json but only with a subset of the fields included in the object. @user.to_json :only => [ :name, :phone ] Although i am using currently the ASP.NET MVC Json() function it doesn't let me define which fields i want to include in the conversion. So my question is whether or ...

How to use JSON to re-build the Javascript Object?

I have an object like this: var someObj = Class.create ({ initialize: function(objName){ this.objName = objName; } }); I can use o = new someObj("objName"); to make an obj. I can use Object.toJSON(o) to change the o to become a JSON String, but I want the JSON String convert back to someObj, so, I use eval() to pass the...

How to Sort JSON Products with PHP

how would I sort these two products by say "id:17 value:### " {"id":"16","value":"L-AOC000"},{"id":"17","value":"6.00"},{"id":"18","value":"10.00"},{"id":"19","value":"7.52"},{"id":"20","value":"4.75"},{"id":"21","value":"3.50"} {"id":"16","value":"L-AOC001"},{"id":"17","value":"7.00"},{"id":"18","value":"11.00"},{"id":"19","value":"6....

jquery autocomplete with json response

im getting response in json, but this wont parse the json response. what m i doing wrong? i could'nt find anything on doc http://docs.jquery.com/Plugins/Autocomplete $("#users-allowed").autocomplete("/people/following.json", { width: 320, // max: 4, highlight: false, scroll: true, scrollHeight: ...