json

How do you pass a JSON object to an MVC action parameters?

I would like to pass {"id":1, "name":"stackoverflow", "parameter2":false, "parameter3":true} To my action public JsonResult Action(int id, string name, bool parameter2, bool parameter3) { //... } Using JQueries ajax method using the JSON as the data parameter $.ajax({ url: "target.aspx", data: {"id":1, "name":"stackover...

Using JQuery getJSON method

Hi, I am attempting to pase a a JSON data using the JQuery getJSON function. The REST query is: http://query.yahooapis.com/v1/public/yql?q=select%20woeid%20from%20geo.places%20where%20text%20%3D%20%22london%22&format=json&jsoncallback=? The script I'm using to parse 'data' to obtain the WOEID value doesnt seem to work below:...

What's faster to parse lots of data (5Mb): eval or json?

I want to get, via ajax, a collection of data objects and parse them into JS data. Currently I have 2 choices: - Server returns valid javascript code and then I eval it. - Server returns JSON object and then I eval the json object What is the fastest of these in Firefox? (I only care about the "parsing" performance, not server or da...

JSON - safely add a variable

How do I safely add a variable to JSON data with C#? For instance I might have [{"data": "data"}, {"data": "data"}] or I might have {"data": "data"}. How do I add a new variable "newdata": "newdata" to the structure? ...

Validate JSON against a schema in .Net

I know there is a proposed standard for JSON schema validation, is there an implementation in .Net? ...

Invalid Label - jQuery Ajax/Json request

Hi, I've been pulling my hair out over this; function status_update( token, loader ){ $("#status-submit").bind( 'click', function(){ try{ $("#status-feed-result").html( loader ); $("#status-input").attr("disabled", "disabled"); var status_input = $("#status-input").val(); $.ajax({ type: '...

Dynamic notifications using jQuery

I'm currently building a homepage for our staff which is to be set as the homepage in their browser. I'm currently building the facility whereby nominated members of staff can send notifications to all staff. These will popup on their home page without the need for them to refresh the page. I've currently got the code below which worked...

What's wrong with my JSON?

Anybody out there notice anything wrong with this JSON? It validates at JSONLint.com, but neither Chrome nor Firefox's native JSON parse functions will properly parse it. Any ideas? { "result": "{\"players\":[{\"name\":\"User 522\",\"turn\":true,\"score\":0},{\"name\":\"User 925\",\"turn\":false,\"score\":5}],\"enableContr...

How to return a MVC View to a $.Ajax JSON POST

I am sending a $.Ajax POST to a MVC Controller function with parameters and returning a JasonResult successfully. What I need to happen is that the current View be returned (as if it was not a JSON request and I was returning the Viewdata). The Viewdata has been updated and the page needs to be redrawn. In short, I want the MVC Action ...

latest org.json

Hello A simple question where can I dn the latest org.json jar? The API shows 2010/01/05 for JSONObject and my last dn was 09/06/15. I cant find it on sourceforge or anywhere else. Can someone direct to the latest that will have an API at least as specified as of 2010/01/05? tia. ...

capture data from FORM using jquery/ajax/json

i have few textbox on the form and when the user submit i want to capture the data and insert into db here is what my code looks like beforeSubmit: function(data) { // called just before the form is submitted var item = $("[id$='item']"); var category = $("[id$='category']"); var record = $("[id$='record']"); var jso...

Dojo reading a json file from a local filesystem using dojo.xhrGet

Hello, I'm trying to read a file from a local filesystem. I do not have a server at my disposal and thus i'm trying to do it this way. Here is what I got so far; function init(){ netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite'); dojo.xhrGet( { url: "/json/coursedata.json", handle...

JSON Beautifier

Hi, do you know any "JSON Beautifier"? Thanks! From {"name":"Steve","surname":"Jobs","company":"Apple"} To { "name" : "Steve", "surname" : "Jobs", "company" : "Apple" } Example some_magic(jsonObj); // return beauty json file ...

JqGrid doesn't work in ASP.NET MVC2

I have a project in ASP.NET MVC1 using VB.NET controlers and JqGrid. it works fine under MVC1. After migrating the project to ASP.NET MVC2, the grid is no longer populated. It seems that there is some new restrictions on returned Jsonresult in MVC2. How to solve this in VB.NET. Controler function populating the jqgrid is something like t...

Importing data from a JSON file into R

Is there a way to import data from a JSON file into R? More specifically, the file is an array of JSON objects with string fields, objects, and arrays. The RJSON Package isn't very clear on how to deal with this http://cran.r-project.org/web/packages/rjson/rjson.pdf. ...

Blackberry JDE JSON parsing?

Every tutorial I can find for parsing JSON with J2ME or Blackberry JDE points to this library: http://www.json.org/java/org.json.me.zip However, this is a dead link. And the googling, it does nothing. Can someone point me in the right direction? ...

Server-side access to Client Browser's Latitude/Longitude using Django.

Hello, So i am writing a little app that compares a user's position against a database on web-based server written using Django and performs some functions with it. Accessing the browser's geolocation data (in supported browsers ) is fairly trivial using JavaScript. But what is the best way to allow the Django server to access the lon...

How do I do this in my Django URLs? (.json, .xml)

Suppose this is my URL route: (r'^test/?$','hello.life.views.test'), How do I make it so that people can do .json, .xml, and it would pass a variable to my views.test, so that I know to make json or xml? ...

How can I deal with this encoding?

Hi all, I'm now trying to parse chrome bookmarks, but I encounter a problem. the bookmarks snippet is presented as follow: { "date_added": "12915566290018721", "id": "16", "name": "hao123\uFF0D\uFF0D\u6211\u7684\u4E0A\u7F51\u4E3B\u9875", "type": "url", "url": "http://www.hao123.com/" } ...

what is the difference between json and xml

what is the difference between json and xml ...