json

Structured JSON layout

I'm working with JSON by PHP at the moment, when I encode it, it would output as: {"username":"ND","email":"[email protected]","regdate":"8th June 2010","other":{"alternative":"ND"},"level":"6"} When I would like it to output like this: { "username": "ND", "email": "[email protected]", "regdate": "8th June 2010", "other": ...

Parse and Stringify JSON in PHP 4

Possible Duplicate: php4 with json data Is there a library or class that provides parsing (JSON to PHP primitives/arrays) and stringifying (PHP primitives/arrays to JSON) for PHP 4? ...

jqGrid with JSON is rendering table but without data in MVC Project

I have set up jqGrid with JSON in my .Net MVC project. The grid is rending, but the data is not appearing. I am not sure what the problem is. Any help would be very much appreciated. I have the code below in my controller. jsonData does get filled and passed to my Index. While stepping through the code I can see that jsonData has 1...

json and jquery image gallery

few months a go i created an image sliding gallery where when use click the left/right arrows one image slides out and the new image slides in (it worked good) all the related images and descriptions i had to write went in my php file; now i wanted to have some new images and i found that add and modifying this content took me longer th...

JSON data in NSMutable Array is out of scope and tableView won't display the cellData

So i'm working on an iphone app that parses json and tries to put the results into a plain UITableview. I have my tableview setup in the xib file and also setup the datasource and the delegate as the MainViewController (this is utility application). I get the JSON request just fine and I always test this by outputting it to a text label...

SimpleJSON and NumPy array

What is the most efficient way of serializing a numpy array using simplejson? ...

How (or more appropriately: Why) does JSON.Stringify change the Date() value?

See example of the issue here: http://www.jsfiddle.net/s2uYE/ Notice the second new Date() is 1hr behind the first new Date() even though they are initiated at the same time. This caused me so end of confusion in a recent project and I would just like to know why this happens and if this is a bug in how browsers handle dates when strin...

What is the correct way to encode an inline javascript object, in order to protect it from XSS?

It turns out the following which looks like valid javascript, is not: <html> <body> <script> json = {test: "</script><script>alert('hello');</script>"}; </script> </body> </html> The same text, when returned JSON via an ajax api works just as expected. However when rendered in-line results in a basic XSS issues. Given an arbitrar...

validating json string using javascript...

I have this json string {"Table" : [{"subject" : "No Records are there to Display"}]}. If i receive this data i want to alert NO Records Found. Any suggestion. Note: My key field may vary accordingly (ie) here it is Subject and some more like Details,Description. ...

how can i escape the colon from my json object

my json object is {"value":"3:Low:2:Med","fieldName":"multiple_priority"} here i am getting output as 3 low 2 med but, i need the output as 3:low 2:med how can i get it? Thanks, ...

More Ajax / MVC weirdness

I've been puzzling over some odd behaviour with my MVC2 project for the last few nights. I have an MVC action result that accepts a project ID and a complex Json object, looking like this: [HttpPost] public JsonResult AddStory(int projectid, Story story) { try { Project prj = repository.Single(p => p.ID == projectid); ...

Pagination problem in jqgrid with array data.

I am facing problem with pagination in jqgrid with array data having 18 records, but the records are not displaying in pages even I specified pagination:true,pager:jQuery('#pager1'). Can you please help me to implement pagination instead of scrolling. <script type="text/javascript"> jQuery("#list4").jqGrid({ datatype: "clientSide", h...

Translate JSON MQL queries into SPARQL

Hi, I have a punch of JSON MQL queries to query Freebase. Is there a tool to translate them into SPARQL to use them with OpenRDF Sesame? Thanks! ...

Asmx web service JSon response doesn't take into account DataMember(Name =

Hi, I can't manage to get a proper json response in an asmx web service. Data structure are defined with DataContract and DataMember attribute but specifying DataMember Name doesn't change response data. Do you have any idea? Here the code (it's for jqgrid): /// <summary> /// a row of the jquery table /// </summary>...

How can i get the colon in output of jsp while using JSON object?

Here i am using Json . By default it will be spilt by colon. but in my output i need the colon in my jsp page.How ever if i use colon it will be splited.... how can i avoid it.... Thanks, ...

How to send/receive json object between JQuery and JSF (Myfaces Tomahawk component library)

I am using JSF(Myfaces Tomahawk component library) and jQuery. All I want is to send json object to jsf bean when i click a button and similarly send a json object(from jsf bean) to page when it's loading. ...

How can i get the colon in my jsp page while using Json?

In my project I am using a JSON object. Here, they format the actual string into a JSON object. Wherever a colon occurs it will separate and print it in different lines in the jsp page, but in my case part of my data needs to display the colon in the jsp page. Because of the json object it will be print in separated line. For example, ...

Parsing json in Android

Can anyone send me link which has an example for parsing json in android with a detailed description? ...

MVC 2 JSON equivalent to FormCollection

Is there a JSON equivalent for FormCollection form as a POST action parameter? I have a dynamically generated number of fields that I need to post back via JSON. ...

Jquery TextArea JSON and Illegal Character - most notably the £

I have a textarea, and am using $('#mytextarea').val(), and when i have text that is '£' i am getting the infamous black diamond with a question mark in it. �, When i package this up as a JSON packet it then gets sent to the server and it interprets it like this: "£" on the server side. I am sending it to the server with this code: j...