json

Using jQuery and JSON with AJAX responseText?

Ok, I'm a bit new when it comes to jQuery and json. If I'm using json as my return type, can I still retrieve responseText from an XMLHttpRequest object? here's the code that i'm using: json response: {"clients": []} $.ajax({ type: "POST", url: "/myurl/whatever.php", data: myData, dataType: "json", ...

Good .NET libraries for working with JSON data?

I am currently trying out Json.NET, and it seems to work well. Any other good JSON libraries for .NET? ...

Returning pure Django form errors in JSON

Hi I have a Django form which I'm validating in a normal Django view. I'm trying to figure out how to extract the pure errors (without the HTML formatting). Below is the code I'm using at the moment. return json_response({ 'success' : False, 'errors' : form.errors }) With this, I get the infamous proxy object e...

Essential Dojo

I'm starting to use Dojo; this is (essentially) my introduction to AJAX. We have a Java backend (torque / turbine / velocity) and are using the jabsorb JSON-RPC library to bridge Java and Javascript. What do I need to know? What is the big picture of Dojo and JSON, and what are the nasty little details that will catch me up? What did...

RESTFull JSON response from asp.net page

Instead of using the web services infrastructure provided by .net, I was wondering what your take on rolling my own asp.net page that you can post data to (I guess all the cool kids are calling this REST,) and retrieving a JSON response from. Is there additional overhead in using an aspx page for this purpose that i'm not aware of? ...

PHP: is JSON or XML parser faster?

I'm building classes that interface with the Twitter API, and I'm wondering whether PHP's built-in XML or JSON parser is faster? Twitter will send me the same data in either format, so PHP performance will determine my choice. I'm using php_apc, so you can disregard parse time and assume I'm running off bytecode. Thanks! more: I'm jus...

Waiting for JSON data to be parsed

Is there a way to wait for jQuery's getJSON method? I want to parse the data, recieved with this function and just return false/true if a specific string is contained. But due to the asynchronous data processing this seems not to be that easy. Here is a code snippet: contained = false; $.getJSON(URL, function ( data ) { $.each( da...

What do I need to escape in my HTML (JSON response)

Hi, My JSON response looks like: {rc: "200", test: "", user: "<div class='sub1'> <div class='avatar'> <a href='/blah'>blah</a><br /> <strong>0</strong> </div> <div class='sl'> <p> you d...

Php Convert to ISO-8859-9

Hello, I use JSON to encode an array, and I get a string like this: {"name":"\u00fe\u00fd\u00f0\u00f6\u00e7"} Now I need to convert this to ISO-8859-9. I tried the following but it fails: header('Content-type: application/json; charset=ISO-8859-9'); $json = json_encode($response); $json = utf8_decode($json); $json = mb_convert_enco...

LINQ to JSON

I am trying the execute the sample code of LINQ to JSON (mentioned below) but it is giving me following error Stack Trace: [InvalidOperationException: Lambda Parameter not in scope] Code I am executing is: JObject rss = new JObject( new JProperty("id", "James Newton-King"), new JPrope...

Web-based JSON editor that works like property explorer with AJAXy input form

Background: This is a request for something that may not exist yet, but I've been meaning to build one for a long time. First I will ask if anyone has seen anything like it yet. Suppose you have an arbitrary JSON structure like the following: { 'str_title':'My Employee List' ,'str_lastmod': '2009-June-15' ,'arr_list':[ ...

JSON request failing because of line breaks, how to escape them?

Hi, My JSON request seems to be failing because of line breaks (I am programatically weaving my own JSON string). How can I escape for line breaks? {"rc": "200", "m" : "", "o": "<div class='s1'> <div class='avatar'> <a href='\/asdf'>asdf<\/a><br \/> <strong>0<\/strong> ...

Using json.net, how would I construct this json string?

Hi, I was weaving my own json programatically, and was adviced to not roll my own as escaping for the forward slash and line breaks won't be enough basically. My json is to look like: {"rc": "200", "m" : "", "o": "<div class='s1'> <div class='avatar'> <a href='\/asdf'>asdf<\/a><br \/> ...

mochijson2 examples!

I'm a two-week old infant with regards to Erlang and Mochiweb. Earlier I had a system running on PHP and soon I realised that it wasn't going to be able to handle the kind of load I was expecting. So I decided to switch the backend to a Mochiweb based server. Right now I need to know how to implement JSON with Mochiweb. I'm fully aware o...

Sending Multiple Items to MVC Controller via jQuery.Ajax

If youa are serializing a form using something like jQuery, it will often map the JSON keys and values to the properties of a object on the Controller Action you are posting to. So: jQuery: function PostForm() { $.ajax({ url: "/Home/TestMVC", type: "POST", dataType: "application/JSON", data: $('#for...

"Simple" app server setup under Mac OS X Server?

With Mac OS X Server's included (or freely available) tools, a background in Objective-C and some rusty familiarity with scripting languages...how might one go about "easily" employing REST**ful **JSON services under Mac OS X Server? This is mostly for prototyping so simplicity and GUI tools are appealing though not at the expense of a ...

Json in html

(This may be a dumb question) I am using a RESTful API to get data out of a database such as firstname, lastname etc. The API gives me the data in JSON and I want to use some of it in a webpage. For example, I want to print Welcome firstname lastname. using the data from the JSON string. How do I do this? ...

Using Django JSON serializer for object that is not a Model

Is it possible to use Django serializer without a Model? How it is done? Will it work with google-app-engine? I don't use Django framework, but since it is available, I would want to use its resources here and there. Here is the code I tried: from django.core import serializers obj = {'a':42,'q':'meaning of life'} serialised = seri...

Should I use JSON or AJAX for response data?

Why JSON? I have done some tests today, and the request time for both JSON, or a normal AJAX request was the same. In the "normal request" I have returned the complete text+html tags, in the JSON request, logically I returned a "json return type" and I have created the HTML with client-side JavaScript. I don't get it, why are the big si...

$.ajax working with file and not url?

in the $.ajax function the url part has data.json which is a text file but i want to put a url i.e. the code works with $(document).ready(function() { $('#content').html(''); $.ajax({ url:'data.json', dataType: "json", success: function(data) { $('#content').append('<p>'+...