json

Dynamic object properties in C# and Javascript

I have a table in the database for various settings in my application. These settings can be added to or changed at any time. I would like to pull them out of the db into an object and reference them in both my server code (C#) and client code (JS). SettingGroup SettingName type value Core defaultPagingSize numeric ...

JqGrid addJSONData + ASP.NET 2.0 WS

Dear community ! I am a bit lost. I' ve tried to implement a solution based on JqGrid and tried to use function as datatype. I've setted all by the book i guess, i get WS invoked and get JASON back, I got succes on clientside in ajaf call and i "bind" jqGrid using addJSONData but grid remains empty. I do not have any glue now... other "...

DataTable to Json using jquery

I'm trying to execute a web service which returns a DataTable with the following piece of code: $.ajax({ type: "POST", url: url, data: data, contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { //do things } }); If the webservice retur...

Json JQuery conflict

Our enterprise app currently uses Json.js I downloaded the JQuery js file, included it in a page that uses json and I started getting Javascript errors in the json.js file. The error is: Microsoft JScript runtime error: Object doesnt suppor this propety or method Is this a known issue? EDIT: I am not sure where this json.js file was...

Ajax: Definition vs Implementation? (XML vs JSON vs Other)

AJAX actually means Asynchronous Javascript And XML. This term was derived because (as I know the story) the first people who started this process transferred data from the server to the client via XML. Lately (well ever since I've started using it actually), JSON has been around and appears to be a real alternative to XML. From my (p...

How To Elegantly Handle JSON Objects in Responses From Ajax Requests?

I'm really new to using JSON to handle my Ajax Request and Response cycle. I've previously used just plain old parameters passed as POST data and I've rendered straight HTML in the response which was then placed into the DOM. As I've looked at various examples and read through various tutorials, it seems like a fairly common practice to ...

jQuery: form returned on "success" needs re-binding

hello. a quick question. I am using the jQuery.forms.js plug-in. I have a form that posts to a php page and returns data with jSon. The data that is returned is code for a new form (it replaces the form that was used to post the information). The new form is not bound to any jQuery functions, as it was not around when the page loaded...

Difference between json.js and json2.js

Can someone tell me what the difference is between the 2 json files? http://www.json.org/json.js http://www.json.org/json2.js I have a JSON file from 2007-04-13 (It has methods such as parseJSON). I don't see these methods in any of the new versions. ...

Example of JSON-P with WCF?

I'm trying to make a WCF service that will work with JSON-P (long-story short, we have to call the web-service cross-domain and receive a call-back, so I need it to work with JSON-P). I found a code-sample on MSDN (http://msdn.microsoft.com/en-us/library/cc716898.aspx). If I extract the ZIP file and navigate to Samples\WCFWFCardSpace\WC...

Cross-site ajax call to a WCF Service

Is it possible to do a cross-site call, in Javascript, to a WCF service? I don't mind if it's a POST or a GET. But I've heard that these days, browsers don't allow cross-site calls with either POST or GET. How can I circumvent this and still call a WCF Service? ...

How to serialise on object to JSON in Javascript

I'm a Javascript newbie so bear with me. How can I serialise an object to JSON in Javascript? Is there a common external library I can use? I'm aware of jquery.getJSON(...) but this doesn't seem to quite do what I want, which is to simply get a string containing the JSON for an object in a piece of Javascript. ...

Iterating through list of keys for associative array in JSON

I have an associative array in JSON var dictionary = {"cats":[1,2,37,38,40,32,33,35,39,36], "dogs", [4,5,6,3,2]}; Can I get the keys from this? I tried in Visual studio putting a breakpoint but can't see any property that represents keys. Is it not possible? I'm fine creating a separate array if necessary, but was just hoping it wasn...

jQuery JSON Problem...

I want to populate form fields with values from a database immediately after the user enters a value in the #sid field. Here is my jQuery/HTML example: <script src="jquery-1.3.1.min.js"></script> <script type="text/JavaScript"> $(document).ready(function() { $('#sid').bind("change", function(){ $.getJSON("test.php?sid=" + $("#sid...

Java implementation of JSON to XML conversion.

Are there existing JARs available to convert from JSON to XML? ...

How do I edit a global variable in a JQuery $.each function?

Ok, so that title probably doesn't explain my question well. Hopefully this makes sense. This is also my first application with jQuery, so forgive me if I'm doing something dumb. I have the following function: function getRandomImages(limit) { imagesArray = new Array(); $.getJSON('createImageArray.php', {limit: limit}, function...

ASP.NET MVC How to pass JSON object from View to Controller as Parameter

I have a complex JSON object which is sent to the View without any issues (as shown below) but I cannot work out how Serialize this data back to a .NET object when it is passed back to the controller through an AJAX call. Details of the various parts are below. var ObjectA = { "Name": 1, "Starting": new Date(122164450...

What should my JSON string look like in my Action in MVC?

Hi, in .net mvc my action looks like: public ActionResult TestAjax(string testID) { return Content(@"{first: ""1"", second : ""2""}"); } In my javascript I am doing: function(data) { alert(data.first); } I am getting [object Object] as the output, why is that? Is my JSON string wrong? ...

Repeated Keyword Value in JSON

On JSON.org the essential data structures that JSON represents are given as A collection of name/value pairs, and An ordered list of values. I have not been able to find anywhere whether a second member having the same name as one already parsed into the current object should (a) throw an exception or (b) replace the existing membe...

ASP.NET MVC automatically decoding JSON-encoded parameters from AJAX

When my JavaScript code uses AJAX to call an ASP.NET MVC method, it passes values in JSON. For example: var request = new XMLHttpRequest(); request.open("GET", "http://www.awesome.com/DoSomething?param1=%22some%20string%22&amp;param2=1234", true); // parameter string created with JSON.stringify or var request = new XMLHttpRequest()...

Json.Net How to Serialize a JObject without the formatting?

This is basically my problem: I have a JObject (I'm using Json.Net) that I constructed with LINQ to JSON (also provided by the same library) and, when I use the "ToString()' method with object, it throws the results in formated JSON. How do I set the formatting to "none" for this? Thanks in adavance =) ...