json

How to cache JSON data for offline reading in iPhone APP?

I'm new to iPhone development and I still have some gaps that needs to be filled in the first application I'm developing. This app will consume data from a site managed by Wordpress through the Wordpress JSON plugin, which allows to retrieve the posts in the form of a json string. I wanted my application to store the posts in some form...

How do I get at the raw JSON response from a jQuery $.getJSON() request?

How do I get at the raw JSON response from a jQuery $.getJSON() request? I just want to print the raw response in an alert() dialogue in my browser? ...

How can I ensure that my Python regular expression outputs a dictionary?

I'm using Beej's Python Flickr API to ask Flickr for JSON. The unparsed string Flickr returns looks like this: jsonFlickrApi({'photos': 'example'}) I want to access the returned data as a dictionary, so I have: photos = "jsonFlickrApi({'photos': 'test'})" # to match {'photos': 'example'} response_parser = re.compile(r'jsonFlickrApi\...

Is there any way to load json from a subdomain?

I'd love to stash some .json files on a CDN a la static.mydomain.com. Truth be told, static.mydomain.com is a CNAME in front of an Amazon S3 bucket. I understand this violates the JavaScript security model. Is there an advised workaround or design? I've seen server-side stuff suggested like a PHP script to suck down data via cURL or fil...

how to check error in json means 500 error in asp.net mvc

when i send json. it may be have something wrong. server does not accept request and give error 500 even i seding a json he return a error page in json. how i can check that i have 500 error in json when as result after my json is gone to server. how i can check that server return 500 error i am talking about .NET ...

Javascript JsON get object member name

Hi Guys, this is might be a very basic question, but seems like it's not easy to find the answer. I have a Json, more or less is like: languages = { "aa":{"iso639-2T":"aar","family":"Afro-Asiatic","labels":{"language_names":["Afar"],"native_names":["Afaraf"]}}, "ab":{"iso639-2T":"abk","family":"Northwest Caucasian","labels":{"language_...

How to JSON data using $.getJSON from a php file ?

I have a php file that receives data from mySQL table. The mySQL table 'user_spec' has only one field 'options' that it returns. Then I convert returned data into JSON, under is code doing that. <?php $username = "user"; $password = "********"; $hostname = "localhost"; $dbh = mysql_connect($hostname, $username, $password) or die...

Moving through JSON data in iPhone app

Hi all I'm afraid I'm a newbie to objective-c programming, and I am having a problem that I have spent all day trying to figure out and I cannot, so I am humbly asking you guys if anyone can help. I am trying to read the details from a JSON page online (for instance a local services directory) and have installed the JSON library into X...

Parse a JSON query response string in ASP.NET

Hey guys I have the following code working which is sending a GET Request and receiving JSON Response. Now I can basically go GetWeatherByLocation(53.3, -6.28); and the method returns {"status":"OK","url":"http://www.link.com/areas/rathfarnham-11","name":"Rathfarnham"} I was now wondering how can I retrieve the values for URL Nam...

Illegal Token error while decoding JSON on Zend Framework

Guys, Im running this example given on zendcasts and i seem to be getting a "Illegal Token" error. An error occurred Application error Exception information: Message: Illegal Token Stack trace: #0 /Applications/Zend/Zend Studio - 7.2.1/plugins/org.zend.php.framework.resource_7.2.0.v20100324-1300/resources/ZendFramework-1/library/Z...

asynchttp and rhomobile

Hello, How can i display JSON data in a rhomobile application without saving it to a database? thanks ...

jQuery loop checkboxes and tick ones which id exists in an array of number

Hi, I'm working on a script which will get a JSON array of id's. Based on the results, I then loop over all the checkboxes on the page and check the boxes where the id exists in the JSON array. The checkboxes are named like so name="name[id]" id="name[id]" How do I loop the checkboxes and determine if the id (between [ and ] ) exists ...

jQuery nested $.getJSON not working

Hi guys, I am trying to retrieve some data from a database using jQuery's $.getJSON method to display in a table, but for each user who's info I get, I have to get the many related systems related to that user, which requires a second $.getJSON call nested in the first, which I have tried turning into a function, which seems to be work...

How to read json file format and how to write the json in c# asp.net

In my ASP.NET MVC project I am conecting to a remote cloud server which is returning the data in json like: [{ "name":"new-service-dev", "Isenabled":"true", "ttl":86400, "cdn_uri":"http://c0099.cdn2.files.rackspacecloud.com", "referrer_acl":"", "useragent_acl":"", "log_":"false" }] Now I want to get all th...

jquery+jstree in c#.net - webservice responseformat?

I have been playing with jstree (1.0rc2)+jquery (1.4.2) for the first time with c#.net and although I have gotten it working, there are a couple things that I don't understand about how data is provided to the tree by the webservice I use to populate the tree (using ajax and the json_data plug-in). I was hoping someone with more experien...

is it possible to proccess JSON responses with the JDK or HttpComponents only?

Hello, we are upgrading our web app to use Facebook's Graph API, which returns JSON responses. However we don't want to add dependecy to a JSON library unless we have no other choice. For server-side http requests we use Apache HttpComponents. Thus, my question is what are the classes (if any) in the JDK and/or in HttpComponents that I...

Objective-C bindings for YAJL: How to put boolean values in JSON dictionary?

I use Objective-C bindings for YAJL in my Mac OS X application. I could not find out how to insert a boolean value (to appear as key:true in the JSON string) in my NSDictionary: NSMutableDictionary* jsonDict = [NSMutableDictionary dictionary]; [jsonDict setValue: YES forKey: @"key"]; The code above does not run (obviously because YE...

JSON deseralization to abstract list using DataContractJsonSerializer

Hello, I'm trying to deserialize a JSon file to an instance of a class that contains an abstract list. Serializing the instance to the Json works well (check the json file below). When deserializing I get a "System.MemberAccessException" with the message "Cannot create an abstract class". Obvisouly the deseralizer is trying to instantia...

Redirection after session expiry for an ajax/json call

Hello I am working on getting data from database by sending a piece of value using the getJSON method of JQuery library, to a PHP function which fetches data from the database. The data is then put into an name:value pair array and is json encoded and returned/echoed. This would help jQuery to populate the required HTML elements with the...

How can I get all values of a mysql table in JSON from a php script?

This is php script that fetches a table values from mysql (one row). & echoes it as JSON <?php $username = "user"; $password = "********"; $hostname = "localhost"; $dbh = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $selected = mysql_select_db("spec",...