json

Error (no data returned) when ResponseFormat:=WebMessageFormat.Json and attempting to serialize an Interface

Update: I have found that the error is occurring in the System.Runtime.Serialization.Json.XmlObjectSerializerWriteContextComplexJson.VerifyObjectCompatibilityWithInterface method. If I switch the WebMessageFormat to XML then it works fine. Is this a bug in the JSON Serializer? System.Runtime.Serialization.SerializationException occu...

Encode a URL Containing a JSONArray

I've got an android application that I'm attempting to use to pass some data to a webservice using HTTPGet. If I just construct the string using the JSONArray.toString() method, I end up with a URL that looks something like the following: http://xxx.xx.xxx.xx/api?method=upload&args[deviceID]=123456789&args[data]=["{element1=9329...

Javascript to Java using JSON

I am planning to send Javascript array object filled with data by encoding it in JSON. Any good jquery plugins for this ? On Java end, what is the standard way of parsing the JSON into a Java array ? Overall flow is like this: Javascript compiles bunch of data on current page and stores it in array. Array object encoded into JSON. J...

Using a generator to stream JSON data in real time from subprocess in Django with JQuery

I want to read in real time the output of a subprocess called from a form in a view. Here is my views.py: @login_required @condition(etag_func=None) def sync_form(request): # do things to validate form return HttpResponse(sync_job(request, job_id, src, dest)) def sync_job(request, job_id, src, dest): # we check the argument...

Simply returning success or failure from ajax call in rails

I have a little ajax call that calls rails: $.ajax({ type: "POST", url: '...', data: ({ ... }), success: function(response, status) { console.log(status); } }); In the rails controller I'm simply deleting an entry from the database, and I simply...

Syntax error while creating a google chrome extension

I keep getting a syntax error everytime I try to load the follow manifest.json: { "name":"Reada", "version":"1.0", "description":"An extension to enable functionality of Arc90's readability", "background_page":"noway.html", "browser_action":{ "default_icon":"hello.png" } "permissions":"tabs" } Line 7, column 1, syntax error. ...

how to make json on iphone using jquery .

i can use this to make a json on web browser: var json_string = JSON.stringify(array); but , it has not a object named "JSON" on iphone , so what can i do ? thanks ...

Deserializing twitter stream json string F#, how to define 'null' as a proper value ?

Hello, I leave the below in case anybody wants the record types, but my question can be asked as following. Suppose one needs to write to a file a record type that can be null, what is the best way to achieve that, considering the below yields: "The type 'Basic' does not have 'null' as a proper value": type Basic = {Toto:string} let...

retrieve application/json document with twill/mechanize in authenticated session

Hi, I need to retrieve a document with MIME type "application/json". I'm using twill to log in to a site and when I attempt to go to the URL pointing to the JSON document and show it, I get this message: 'The HTTP header field "Accept" with value "text/html; */*" could not be parsed.' I have tried changing the "Accept" field to "app...

JSON List of Tags/Values

I am working on a project that requires an object to have multiple values. For instance, a list of 'things' all with a name but each thing also has another category, "Tags" with could include things like round, circle, ball, sport, etc. all words describing what the 'thing' is. I am trying to define this in JSON but I keep running into e...

Retrieving JSON with JQuery

Hello all. I'm trying to retrieve JSON with JQuery from: http://www.chirpradio.org/json How do I retrieve, parse and display that JSON in a web page. I'm new to JSON and JQuery, and the onsite documentation is a bit difficult to follow. Thanks, Moemonty ...

reading json with dojo to show in grid

Hi all, I have been struggeling all day to read a json file from server and view it via dojo datagrid. Please see the code snippets below and help me if possible : the html file is :: <head> <link rel="stylesheet" type="text/css" href="../../_static/js/dijit/themes/claro/claro.css" /> <style type="text/css"> bo...

Outputting jSON in a rails app

ok, rails 3 new developer here. I want my jquery to be able to get a json object from the rails 3 application for projects. Here is my controller. def yourprojects @projects = Projects.all(current_user) respond_to do |format| format.html # index.html.erb format.json { render :json => @projects } end end I added the fo...

JSON parsing and printing JSON object with variable name

I'm having trouble printing an object with a variable name. It works when I hard code it. var objectVarName = "lat"; var obj = jQuery.parseJSON(JSON.stringify(msg)); // {"lat":"93"} is what JSON.stringify(msg) prints $('#display').prepend("<br/><br/>" + JSON.stringify(msg)); ...

My app is sending me JSON. How do I take that JSON and inject HTML into the page?

With $.ajax, I'm getting a JSON response like follows: [{"project":{"name":"P1111", description":"I like chicken soup","active":true}} .....repeats several times] What I'd like to do with jQuery is take that JSON response, and loop through it to create the following on id=target <ul id="target"> <li>P1111 - I like chicken soup - ac...

jquery: howto return caller-id when using wildcard selectors

i'm using jquery to invoke JSON-requests and they're triggered form a bunch of autocomplete-fields. I use wildcard-selector and now need to find out which ac-field that fired the event. ... $( "[id*='_lookupCmb']" ).autocomplete({ source: function( request, response ) { $.ajax({ ... ... select: function( event, u...

PHP, JSON, and MySQL

What is the easiest way to retrieve data from the database, and convert the data to a JSON String? Is there any kind of helper class? or am I supposed to loop through the columns in my dataset to create the JSON string? sample code would be great ...

Get json object without JSON.parse?

I found this: Use Python output: print ‘Content-type: text/x-json\n\n’ print json.dumps([{'title':arr['title']}]) and get json string with Jquery: $ajax( success: function(msg){ if(msg[0].title) alert(msg[0].title); } ) It works, who can tell me why it is? Thanks~ ...

How to compress JSON from PHP and decompress in ASP.NET

Hi I am having a problem passing JSON from PHP server and ASP.NET server. I am getting Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 48 bytes) I am looking for a way to compress the JSON. Thanks ...

how to pass function name in url while using some web service in objective c?

hello, I am a beginner in i phone development.I am,right now, using web service to fetch data on my page.now the thing is that i have 2 functions in the same webpage. now i want to fetch data from only 1 function at the time when my url is passed. so how can i pass the argument? note that,my main purpose is to convert data into json fo...