json

WCF REST and JSON - Serialization and empty elements

Hey, I am returning a list of items (user defined class) in a REST service using WCF. I am returning the items as JSON and it is used in some client side javascript (so the 'schema' of the class was derived from what the javascript library required). The class is fairly basic, strings and a bool. The bool is optional, so if it is absent...

Displaying images from Facebook photo albums on a portfolio site using the graph api

A client of mine would like to be able to update her site's image galleries by adding images to albums on her facebook account. Is this possible using JSON? would the albums she chose to display need to be made public? Thanks for any help on this! ...

[System.Web.Services.WebMethod] return object value using json or another convient class

The javascript does not get value from the web method. It says undefined for the value of s located in CallMe().. My aim is get an object from the web method.... to use the data in js.. What am I missing_? using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; us...

Help understanding a php function - the meaning of $array[]; the [] part.

private function jsonArray($object) { $json = array(); if(isset($object) && !empty($object)) { foreach($object as $obj) { $json[]["name"] = $obj; } } return $json; } We are grabbing an object, and if the conditional is met, we iterate over that object. Then... I'm lost on this reading... :s Wh...

JavaScript Function eval() throwing an out-of-stack quota exception

Hey all, Recently I ran into a problem: Valid JSON when passed to the eval() function causes it to throw the error -- "script stack space quota is exhausted". It is consistently reproducible, and through initial examination, it seems that this is a limitation on the number of object attributes/properties that can be defined (and not th...

At a glance can anyone tell me why this Action is so slow?

This thing was not noticed to be slow at first because there were not many 'tree nodes' in the database. Now it's really slow, at a glance is there anything major that is wrong with this? I really need to optimize it and before I rework the entire thing I was wondering if anything stands out as being the real pain point. I have narrowed ...

Why won't my Servlet respond to JSON requests in UTF-8?

My Servlet just won't use UTF-8 for JSON responses. MyServlet.java: public class MyServlet extends HttpServlet { protected void doPost(HttpServletRequest req, HttpServletResponse res) throws Exception { PrintWriter writer = res.getWriter(); res.setCharacterEncoding("UTF-8"); res.setContentType("application/json; charse...

Struts2 JSON Plugin With Annotations

I have a Struts2 Action Class configured via annotations. All of the "normal" methods that are annotated with @Action work fine. However, I need to add a method into the action that returns JSON. Here is a trimmed down version of my class (dao autowired with Spring): @Namespace("featureClass") // define success and input actions for c...

jQuery evangelists!

I'm absolutely digging what I've been able to do in jQuery. From my perspective there isn't a lot jQuery can't do. I'm working on a new project and my plan is to use jQuery heavily with JSON,Ajax and Webservices inside of a ASP.net project. Before I go spouting my opinion about how great jQuery is, I thought I might ask if there are...

Parsing JSON and customizing it for SIMILE's Timeline Widget

I have a valid JSON dataset: [ { "date": "2008-02-04 19:30:00", "authors": [ { "first_name": "Nassim Nicholas", "last_name": "Taleb" } ], "icon": "djlongnow_media/seminar_icons/salt-020080204-taleb.jpg", "slug": "the-future-has-always...

XML to JSON or To where to use it in .NET c#

How can I gather the data into c# from this xml? I get the data from :http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml PS: I would like to get the currencies rates from a web service, bu I could not find a trustworthy web service, thats why I try from xml... <?xml version="1.0" encoding="UTF-8" ?> - <gesmes:Envelope x...

Rails3: Take controll over generated JSON (to_json with datamapper ORM)

From my Rails 3 app i want a JSON like this: {count:10, pictures:[ {id:1}, ... ] } I tried render( :json => { :count => 10, :pictures => @pictures.to_json(:only=>:id) } ) but in this case, my pictures get escaped ..."pictures":"[{\"id\":2653299}, .... In my old merb app i had the following simple line...

iOS with JSON, PHP

I'm rather new to ios and json. I've managed to create a db in mysql and used php to create a basic read and write php pages. I'm using the TwitterHelper class from cs193p class for the presence assignment from Stanford to acces the php interface online and tie it to my ios code. I am getting an error which I can't solve. Update: O...

How to receive JSON in a POST request in CherryPy?

How to receive JSON from POST requests in CherryPy? I've been to this page http://goo.gl/t4hI [docs.cherrypy.org], and though it does a good job explaining the API, its parameters, and what it does; I can't seem to figure out how to use them to parse the incoming JSON into an object. Here's what I have so far: import cherrypy imp...

Optimal Method to Minify an XML in C# 3.0

Coding Platform: ASP.NET C# I have an XML like this. <Items> <Map id="35"> <Terrains> <Item id="1" row="0" column="0"/> <Item id="1" row="0" column="1"/> <Item id="1" row="0" column="2"/> <Item id="1" row="0" column="3"/> <Item id="1" row="0" column="4"/> ...

My client queries my server. If the response is negative (e.g. error) how should I communicate it?

Should I rely on http status codes? Or should I use some kind of special response? My server is running PHP and producing simple JSON responses. ...

How does Wowhead.com do item popups across fansites?

If you run a site that links to world of warcraft items, you're probably using the wowhead.com javascript to bring their item popups to your site. See it in action here, mouse over the "King Dred's Helm" link. It will popup Wowhead.com's info. is this just a jsonp callback to their site? I want to implement something like this on my si...

Generate a JSON string using Objective-C

I know there are a few frameworks to parse JSON, but how can I generate a JSON string in Objective-C? Will it be something I would have to write myself, or is there something simple already out there? ...

I want to create links in record fields in DataTables from JSON data

I'm creating a dataTables table to use as an archive of pages for a site that produces a comic strip. On that archives page, I'd like to have the title of the comic be a link to the page of that comic strip. Initialization: <script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#ex...

how to serialize json when the value changes from int to array + order may change

I'm not sure how to serialize the following example from json to a c# object. Normally, I do something like this: JavaScriptSerializer ser = new JavaScriptSerializer(); result = ser.Deserialize<Library.Libraries.Model.Post>(responseFromServer); But in this case, I'm not sure how to create the class to base it off since the values an...