json

accessing parsed JSON on the iPhone SDK

Hello All! I've been following the great tutorial about (iPhone, json and Flickr API and I did manage to access the parsed json info just fine. Now I'm trying to do the same thing with the Twitter API, and I am able to get the json info and parse it, but I can't seem to access it like in Flickr. I noticed that the json info that is ret...

Create dynamic view with android

Hi I'm stuck on a problem and if possible I will need help from the community. I'm not looking for a ready-made solution, but something which would help me to produce the result. I'm looking for a way to produce a dynamic activity based on a JSONArray object. Here an example of a JSONArray object: [ { "name": "my checkbox name", "...

Parsing array data

I am trying to parse this array data that way generated from JQuery and JSON. Array ( [d] => Array ( [0] => Array ( [order] => 1 ) [1] => Array ( [order] => 2 ) [2] => Array ( [order] => 3 ...

Parsing JSON with GSON

I'm having some trouble with GSON, mainly deserializing from JSON to a POJO. I have the following JSON: { "events": [ { "event": { "id": 628374485, "title": "Developing for the Windows Phone" } }, { "event": ...

Retrieving data from a JSON sub array in javascript, where identifier starts with an integer

I must be missing something simple here, but I'm having trouble retrieving data from a JSON array response. I can access objects with identifiers that start with letters, but not ones that start with numbers. For example, I can access data.item[0].specs.overview.details But I can't access data.item[0].specs.9a99.details If anyone...

UTF-8 conversion

Hey guys, I am grabbing a JSON array and storing it in a NSArray, however it includes JSON encoded UTF-8 strings, for example pass\u00e9 represents passé. I need a way of converting all of these different types of strings into the actual character. I have an entire NSArray to convert. Or I can convert it when it is being displayed, wh...

JQuery error: XML filter is applied to non-XML value (function (E, F) {return new (o.fn.init)(E, F);})

I am getting this slightly cryptic error message: XML filter is applied to non-XML value (function (E, F) {return new (o.fn.init)(E, F);}) when I run this code snippet function justDoIt(arg){ msg = arg.msg; if(arg.ok) jQuery.(".action-button").each(function(idx,el){jQuery(this).removeClass('enabled');} ); } arg is a ...

passing string to a AJAX/JSON function

I’m having trouble getting a AJAX/JSON function to work correctly. I had this function grabbing value from a drop down box but now I want to use an anchor tag to set it's value. I thought it would be easy to just use the onClick event to pass string to the function I was using for the drop down box but it doesn’t do anything. I’m stumpe...

Access variable from code behind via javascript

Hi, I have the following code that I want to return to a variable "t" in javascript: Code behind: Public Shared Function GetSomeText() As String Dim result = "This is from code behind" Return result End Function Caller variable in javascript: //This is not working like that, I think var t = GetSomeText(); So, how can I ma...

How to deal with JSON output that might be an array, or might be a value

Hi - I'm getting JSON-encoded output from another organization's API. In many cases, the output can be either an array of objects (if there are many) or an object (if there's just one). Right now I'm writing tortured code like this: if ( is_array($json['candidateList']['candidate'][0]) ) { foreach ($json['candidateList']['candidat...

JSON onFailure issue

I’m having trouble getting a AJAX/JSON function to work correctly. I had this function grabbing value from a drop down box but now I want to use an anchor tag to set it's value. I thought it would be easy to just use the onClick event to pass string to the function I was using for the drop down box but I get the alert in JSON onFailure ...

jQuery: ajax polling plugin alternative (instead of PeriodicalUpdater?)

Hi, I'm trying to poll a script every few seconds. The script will return a timestamp, and if this timestamp is different from the previous (the first time is always true since it's comparing with nothing), then do something. Thing is PeriodicalUpdater seems to work fine for me. But I read that JSON.parse does not work in IE<8. I'm the...

Jquery get array details

I'm having trouble getting a response back from a Jquery ajax call... (It's a script to authenticate a user, and needs to return their name and user ID. My understanding was that I could encode it as JSON and get the data in the format below. It is returning an error of "undefined" for the alert(). The javascript $.ajax({ type: "PO...

Rails escape_javascript creates invalid JSON by escaping single quotes

The escape_javascript method in ActionView escapes the apostrophe ' as backslash apostrophe \', which gives errors when parsing as JSON. For example, the message "I'm here" is valid JSON when printed as: {"message": "I'm here"} But, <%= escape_javascript("I'm here") %> outputs "I\'m here", resulting in invalid JSON: {"message": "I\'...

getJSON callback not firing

I'm making the call using the following script which is called on click of an anchor tag function GetToken(videoId) { debugger; var json = $.getJSON("/Vod/RequestAccessToken/"+videoId, function(result){ alert("token recieved: " + result.token); }); } In the server application I recieve the cal...

json_encode behaving different on arrayObject vs array()

Hi, I had a function in php: //simple method with array() $sensors = array(); $query = "select id, x(transform(wkb_geometry,". $epsg . ")) as lon, y(transform(wkb_geometry,". $epsg . ")) as lat from mytable;"; $result = pg_query($query) or die('Query failed: ' . pg_last_error()); while ($row = pg_fetch_assoc($result)) { //va...

Deserialize array values to .NET properties using DataContractJsonSerializer

I'm working with the DataContractJsonSerializer in Silverlight 4 and would like to deserialize the following JSON: { "collectionname":"Books", "collectionitems": [ ["12345-67890",201, "Book One"], ["09876-54321",45, "Book Two"] ] } Into classes like the following: clas...

Combine multiple JSON files into one; retrieve using jQuery/getJSON()

I have some jQuery code which retrieves content using getJSON(). There are n JSON files, which are retrieved from the server as needed: /json-content/data0.json /json-content/data1.json /json-content/data2.json etc... Instead, I want to store all the JSON in a single file to reduce the number of HTTP requests needed ...

What is the easiest way to send a Javascript array via JSON to PHP?

I have a few arrays that I want to send to process with PHP. Using json2.js I will stringify the arrays like so: var JSONlinks = JSON.stringify(link_array); var JSONnotes = JSON.stringify(note_array); but then I'm confused. Do I need to use a XMLHttpRequest object? Is there another way? If that is the simplest way, could someone p...

Problem passing json into jquery graph(flot)

I trying to retrieve some json to pass into a flot graph. I know that json is right because I hard coded it to check, but I'm pretty sure that I'm not passing right because It's not showing up. Here's the javascript: var total = $.ajax({ type: "POST", async: false, url: "../api/?key=xxx&api=report&crud=return_months&format=json" }...