json

deserialize json base64 binary in .net using DataContractJsonSerializer

hey, I am having a problem deserializing base64 json back into the .net object using wcf datacontract.... I have this to deserialize: public static T FromJSON( this string json ) { using ( MemoryStream ms = new MemoryStream(ASCIIEncoding.Default.GetBytes(json)) ) { DataContractJsonSerializer ser = new DataContractJsonS...

PHP json_encode unread by jQuery AJAX Post

I'm posting from a form to a URL like so: $.post('?class=articles&method=submit', $(this).serialize(), function(msg) { alert(msg); $(msg.html).hide().insertBefore('#addCommentContainer').slideDown(); $('#body').val(''); },'json'); And in the 'submit' method the last line is: print json_encode( array('html'=>$content) ); ...

How do I scan JSON with jquery to determine the number of instances of a certain string?

Hi, I have some JSON which looks generally like this... {"appJSON": [ { "title":"Application Title", "category":"Business", "industry":"Retail", "language":"English", "tags":[ {"tags":"Sales"},{"tags":"Reporting"},{"tags":"Transportation"},{"tags":"Hospitality"} ], }, { "title":"Airline Quality Assurance", ... ... .....

Dynamically creating a json index won't let me access the data within

I'm trying to use jQuery to send an ajax request to a very simple PHP script to load images for the jQuery cycle plugin. I'm having an issue with obtaining the image source strings from my json object. I'll show my code, then go into more detail below: <!doctype html> <html lang="en-us"> <head> <title>jQuery Cycle test</ti...

How do I turn Moose objects into JSON for use in Catalyst?

I have a series of Moose objects that I'm looking to feed to JSON::XS by way of Catalyst::View::JSON. JSON::XS is unable to encode blessed data-structures. I know that there is MooseX::Storage::Format::JSON which can -- kinda -- do what I want; but, it seems pretty overly heavy. What I'm looking for is essentially the same information th...

iPhone apps and state aware web connections

I'm working on an interface for an existing web application that will allow iPhone and other mobile clients. I have started implement a JSON API and I need to give some detailed specificaitions for the App to an iPhone developer. What I am curious about is whether other developers are using session data in their JSON / mobile client co...

rendering multiline Javascript by using JSONP in rails

Hello, In a controller I try to render a javascript google ad to print it into some HTML using JSONP, like this <script type="text/javascript"><!-- google_ad_client = "pub-23222424"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; //--></script> <script type="text/javascript" src="http://pagead2.googl...

asp.net webservice returning XML instead of Json object

hello, I made a post here: http://stackoverflow.com/questions/3386398/httpget-fail-when-passing-c-entity-class-to-json-jquery my problem is, its returning an XML on its xhr.responseText rather than a Json object. HELP! ...

How do I use JSON objects from Facebook with PHP?

Hiya! http://developers.facebook.com/docs/reference/api/event I'm trying to grab some values from a Facebook JSON even object in PHP. Namely, title of event, location, and people attending. Using the Graph API. <?php $jsonurl = "https://graph.facebook.com/331218348435?access_token=2227470867|2.rtBZMkVIVgKGZ7Xr4px3Dw__.3600.1280822400-...

Sending Ajax request only once

I'm using the following code to call a function when the main browser's url changes. var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIWebNavigation) .QueryInterface(Components.interfaces.nsIDocShellTreeItem) ...

Convert Json Array to normal Java Array

Is there a way to convert JSON Array to normal Java Array for android ListView data binding? ...

Jquery: Remove previous data in a select list

Hi all, i had the following question. i want to update my subcategory select list when the user select a specific leadcategory and show in other select list the subcategories. The problem is that i can't figure out when i'm selecting a another leadcategory my previous subcategory has to remove and fill with the new data depending wi...

Trim leading and trailing white spaces in JSON values

All, I make a JSON request to a web server using PHP and it returns me a JSON response in a variable. The JSON response will have lots of keys and values. I would like a function which trims leading and trailing white spaces in each "value" of the key-value pair for the entire JSON response. How can I do that through PHP? Ex: json_dec...

json client in java for Restful service

Hi, Typically I have been using xml web services and have used JAXB for marshalling/unmarshalling the xml. In this case, I have an xml schema for generating the classes and then at runtime I simply deal with java objects and not with xml since that unmarshalling is done under the covers for me. What sort of libraries exist for doing so...

Creating REST parameters for jQuery consume webservice

I am using jQuery to consume a web service I built, the input is currently serialized JSON, as well as the output via jQuery AJAX. I'd like to make the service more RESTful by adding URI query string parameters so that users can access the same same page of search results, query string, etc. etc., when they save the URI as their state. ...

Is it preferable to preserve web application state with JSON in URL?

You could preserve web application state with JSON in URL like this: http://host/?state=[{id:1,selected=true},{id:2,selected=false}] Is this preferable? One motivation for doing something like this is if the user bookmarks the web page the web application state can be restored the next time the user visits the page. ...

PHP solutions for storing forms in JSON

Forgive my second-rate google-fu, but I'm finding this topic tricky to search for. All I can find is crappy form-generators that will pump out HTML. I'm looking for a library or established approach to store forms (fields rather than form data) in JSON format. Is there either a open-source form-builder that takes simple input and makes ...

Parse google reverse geocode json on iphone

I'm using json-framework to parse some simple json in my iphone app, and it works fine. But now I'm needing to parse the json from google's reverse geo-coder which is very complex and really big. The json output can be seen here: http://maps.google.com/maps/geo?q=40.714224,-73.961452&amp;output=json&amp;sensor=true_or_false I'm trying t...

Json_encode, json_decode and UTF8

All, I make a JSON request to a web server using PHP and it returns me a JSON response in a variable. The JSON response will have lots of keys and values. The JSON response I get from the server has special characters in it. So, I use the following statement to convert it to UTF8,decode the JSON and use it as an array to display to the ...

JSON Array iteration in Android/Java

Hi all, I am building an android app that needs to download and synchronise with an online database, I am sending my query from the app to a php page which returns the relevant rows from a database in JSON format. can someone please tell me the best way to iterate through a JSON array? I receive an array of objects: [{json object},...