json

Is there a way to trap all errors in a AJAX-web service?

I'd like to trap any unhandled exception thrown in an ASP.NET web service, but nothing I've tried has worked so far. First off, the HttpApplication.Error event doesn't fire on web services, so that's out.. The next approach was to implement a soap extension, and add it to web.config with: <soapExtensionTypes> <add type="Foo" priori...

Spring, Jackson and Customization (e.g. CustomDeserializer)

Being still a little unfamiliar with Spring, I have encountered a problem that makes it necessary implementing my a custom deserialzer for Jackson. The procedure is described in a small tutorial, however, I am stuck with Spring. I do not understand, where ObjectMapper mapper = new ObjectMapper(); in Spring MVC is carried out when js...

how to parse this json response?

hi i know how to parse response like {\"screenTitle\":\"National Geographic\"} token.optString("screenTitle"); up to this ok. but see this response { "status": "OK", "routes": [ { "summary": "Southern Exp", "legs": [ { "steps": [ { "travel_mode": "DRIVING", "start_location": { "lat": -34.925...

php: Get url content (json) with cURL

I want to access https://graph.facebook.com/19165649929?fields=name (obviously it's also accessable with "http") with cURL to get the file's content, more specific: I need the "name" (it's json). Since allow_url_fopen is disabled on my webserver, I can't use get_file_contents! So I tried it this way: <?php $page = 'http://graph.facebook...

Top and Sub Category structure

I need to dynamically create a json object full of cats and sub cats. My structure looks like this var cats = { tops: { 'top' : { link : 'link', subs : [ { 'sub' : { link : 'a link' } } ] } ...

jquery json to string?

Instead of going from a json string and using $.parseJson, I need to take my object and store it in a variable as string representing json. (A library I'm dealing with expects a malformed json type so I need to mess around with it to get it to work :( ) What's the best way to do this? ...

Is there a Javascript template system that wraps HTML?

I wonder if there are anything like a Javascript template system that wraps HTML, so that we don't have to deal with HTML directly (yeah, i know it's a bad idea, but just out of curiosity). So instead of writing HTML: <body> <div id="title">Great work!</div> <span>My name is Peter</span> </body> We write in Json: body: [ {div:...

PHP - Recommended max array size - alternatives?

I'm writing a google maps page with about 160 records, 1 for each location. The original map data is held in a sql table. As there is quite a lot of text this could be a max of 900 characters per record. I filter this data my month so there may be 20-30 records shown as markers on the map. I want the user to quickly switch between mon...

Rails 3 vs Sinatra

For my next web application, I'm debating whether to use Rails 3.x or Sinatra. I would like to use the server to provide user authentication, application-triggered emails, a fairly complex data model (behind ActiveRecord), and a JSON data interface with the web client. The client side will use static HTML, static CSS, Javascript/jQuer...

jstree links in multilangual json with cookie plugin

Hello community, First I wanted to say that jstree is a great and powerful utility. My first problem is that I have created a multilingual tree with a json and I don't quite know how to set links there, so when the user clicks on a node (for parents and children) he can get to a page like www.yahoo.com or any link I set as an attribut...

Developing RSS reader for iOS?

I like to make an app that reads articles from a website ad RSS or JSON. What method do I use to grab the XML or JSON to my app? How do I tell when the data is available locally? Thanks. Edit: I'm using Objective-c for iOS. I need code for iOS please. ...

Push JSON Encoded Data To Website in what format?

I need to push some JSON data to my website which I would like to read in PHP. What type of file should I make this? A PHP file with the JSON inside of a variable? I understand how to make a text file with JSON encoded data in it, but how do I get this into PHP? Should I use a PHP include with the JSON-encoded data in it assigned to ...

How to convert Json object to cutom class object in web service?

I've scenario where I want to insert data into database without post back. there are around 12 to 13 fields which i need to insert. I'm passing DTO from the client side which is actually Json object. Now the problem which i'm facing is how to convert that Json object which i got in webservice to the "class" (in my case class name is User...

Posting a list of objects trough json to actionMethod in asp.net mvc

Seems there have been some talk about this issue before, but i will post this anyway.. Public Function test(ByVal val As List(Of TestObj)) As ActionResult For Each o In val Next End Function Class TestObj Property id As Integer Property name As String End Class When trying to call this function trough jQuery's post m...

jquery ui autocomplete, and json returned data from a PDO fetch_obj - Possible?

Hello all, I'm getting the return from the server side like so: [{"nomeDominio":"aaaa.hk"},{"nomeDominio":"agentesdeexecucao.hk"}] Question: Can we use this with the jquery autocomple UI ? It seems we can't and I'm not sure what format does it expects. :s K. Regards, MEM ...

Is it possible to write a table to a file in JSON format in R?

I'm making word frequency tables with R and the preferred output format would be a JSON file. sth like { "word" : "dog", "frequency" : 12 } Is there any way to save the table directly into this format? I've been using the write.csv() function and convert the output into JSON but this is very complicated and time consumin...

Infinite PHP while loop

Hi guys, I am having some trouble with a basic PHP while loop, everytime I launch my test_post.php file in my browser, I get a never ending loop, and I have no idea what I am missing! Here is my PHP code: <?php mysql_connect('localhost', 'admin', '1234') or die(mysql_error()); mysql_select_db('json'); $test = mysql_query('SELECT us...

How to get the JSON Response so i can alert() for debugging

Title says all, i need to JSON response string / object for debugging purposes. How can i get it ? ...

JSON being returned is structures as function call. Can't figure out how to parse with jQuery.

I'm talking to a server and the JSON response looks like this: someResponse({ "Response":{"status":"3","message":"Not valid bla bla"} }); Proper JSON should look like this, right?: { "response": { "status":"3", "message":"Not valid bla bla" } } Is there a way I could somehow reach that data with jQuery i...

Why does Rails to_json sometimes include attributes, attributes_cache, changed_attributes, etc?

My to_json call sometimes seems to include some extra cruft that I'm not expecting: {"response": [{"attributes": { (...actual list of key:value pairs, as expected) }, "json_class":"Survey", "attributes_cache":{} }, {"changed_attributes":{"survey_source":""}, "attributes": { (...actual list of...