json

Is this a correct way to return JSON in Python/GAE for parsing in JavaScript?

I am making an API for some AJAX related things in my web app on GAE in Python. After setting the content-type to 'application/json' and accessing my url directly- http://mysite.com/api?method=theMethod&param=firstParam -I am being prompted with a 'save file' dialog box instead of seeing the JSON object displayed. The file contain...

json xhr response opens a download file popup window

Hi For one of our ajax request (with a .json response) some of our clients have complained that they are seeing a "File Download" prompt asking the user to download the .json response. I am baffled because considering that this is an xhr response, this should never happen. Has anyone seen this? Thanks ...

Cross domain ajax response failing

Ok...so ive been wriggling around with this piece of cod for quite a while now... first i used this code which worked... $(document).ready(function() { $('#content').html(''); $.ajax({ url:'data.json', dataType: "json", success: function(data) { $('#content').append(''+data.rank+''); } }...

Cross Domain json response failing

$(document).ready(function() { $('form#search').bind("submit", function(e){ e.preventDefault(); $('#content').html(''); // Define the callback function function getGeo(jsonData) { $('#content').append(''+jsonData.rank+''); bObj.removeScriptTa...

building a jsonp wrapper for json data

Ive been tryin to solve this for a long time and now know why its not possible. The url http://twittercounter.com/api/?username=Anand_Dasgupta&output=json&results=3 returns a json but when i append a "&callback=get" along with it,it doesnt specify the callback wrapper function. So the only solution now is to build a wrapper m...

How to read json with XmlReader

Given a stream of JSON, how can I read it as XML. I am aware of System.Runtime.Serialization.Json.XmlJsonReader but it is internal ...

Why doesn't Jayrock (.NET JSON-RPC Framework) like my request?

Hi quick question about Jayrock... I have a Jayrock JSON-RPC web service that generally works fine. However, when I try to post to my jqGrid editUrl, Jayrock throws an error. The web service works fine in other situations. Anyone have a clue why Jayrock doesn't like the following request? Perhaps a way to configure Jayrock to accept...

How to iterate over a JSON structure ?

Hello, I have the following JSON structure: [ {"id":"10", "class": "child-of-9"}, {"id":"11", "classd": "child-of-10"}]; how to iterate over it using jquery or javascript? ...

JSON.net returning malformed JSON

Hey, I am using json.net to parse objects and delivering them to a webservice I have made. The objects are LINQ-objects. When I access this webservice with JQuery, it doesn't parse the JSON correctly. There seems to be something wrong with the formatting.. The JSON-string I get is this one: [{"typeid":1, "typename":"binders", "des...

Using JSON serialization as a persistence mechanism instead of RDB

I'm thinking about throwing away my DB in my next project to simplify development/evolution. One way to do it is not to leave the Objects realm at all and persist my objects by some kind of serialization. It would be nice to be able to edit the initial objecs state when the app is down, so format like Json would be great. The problem i...

WCF, JSON, and FreeBase

Hi, I would really appreciate some help on the best way forward with WPF and JSON. Is there any way to query the JSON response below using LINQ? { "code": "/api/status/ok", "result": [ { "id": "/en/exxonmobil", "industry": "Petroleum", "name": "Exxon Mobil", "type": "/business/company" }, { ...

difference between $.getJSON and $.get

Is there really a difference in these two calls? If you use getJSON, you still have to declare format=json in the url... And you can do the same in $.get(), and iterate through the JSON-object. Or am I way off here? ...

jqGrid with ajax binding?

Hi everyone, I'm trying to implement a simple function using jqGrid, but it doesn't seem to work and I was wondering if anyone has an explanation. Basically one column of jqGrid returns (through JSON) <a href="#" id="special">Click</a> Outside the column, I have a jQuery listener that is of the form $("#special").click(function () {...

What to use to process JSON responses on a command line?

I have a nightly executable that will run on a windows or linux server that will be downloading information from various web sources and one of those sources contains a JSON response. This executable will download the information and connect to a SQL server database to update the appropriate records. I come from a C#, windows programmi...

RESTful Content Negotiation in Rails

I'm looking to implement content negotiation on some resources in a Rails app. I'm using Mootools and will likely be able to tweak the content type accepted by an XMLHTTPRequest to "application/json". Is there any way to pick up on this information in my controller and generate JSON responses instead of XHTML? I'm trying to avoid doin...

How to Display the Total Order Amount per Day in a Chart

I cant seem to get this working, i need to display the Total Order Amount per day on the Chart. I got the Open Flash chart to work by the following code: <?php // Settings for Database Connection include_once($root_folder_path . "includes/common.php"); include_once("./admin_common.php"); include_once("./ofc_chart_library/open-flash-...

Convert JSON to HTML Tree

Hi, I would like to generate an HTML tree (preferably UL-LI) from the JSON example below. Does anyone have a simple, recursive JS function (not a framework) that can handle this specific structure? Thanks for your help! { "folder" : [ { "title" : "1", "folder" : [ { "title" : "1.1", "folder" : [ { "title" : "1.1....

Running JSON through Python's eval()?

Best practices aside, is there a compelling reason not to do this? I'm writing a post-commit hook for use with a Google Code project, which provides commit data via a JSON object. GC provides an HMAC authentication token along with the request (outside the JSON data), so by validating that token I gain high confidence that the JSON dat...

Can't send complex json data to server using prototype and rails

Hello, I'm trying to send the following data to the server but at the server side I don't see the json parameter that I'm sending. Can anyone tell me what I'm doing wrong? Bellow you can see the code. Prototype: send_data_url = "change" hash = $H({"blocks": [{"h": "2", "area": [{"width": "96%", "els": [{"title": "first", "mand"...

Javascript prototype undefined after eval deserialization

Attempting to deserialize JSON data and update each object's prototype and inherit a common function. However, the following script throws error "people[0].getFullName is not a function". The prototype for deserialized objects appears to be undefined after assignment. <html> <head> <script> var json = '[ {"firstName": "John", "lastName...