Questions tagged "json" (page No.1)

json_decode intuitively add numeric array keys

The json_decode function expects strictly formed JSON and won't accept values without a key however, the way in which I intend to use it the keys don't matter and repeatedly, manually specifying numerical keys is tedious. The most obvious answer would be to write my own 'JSON' decoder that would intuitively ...

Adding to an array in sqlite3 and passing with json to jquery ajax

I attempt to fill a drop down from a database. I query and add my result to an array. I then use json_encode to send my data to a php file. $query="SELECT project FROM main"; $results = $db->query($query); while ($row_id = $results->fetchArray()) { $proj_option[] = "<option value=\"".$row_id['project']."\">".$row_id['project']."</option>\n"; ...

Parsing Multiple JSON Arrays in Java/Android

If you pass multiple JSON arrays into Java (in a single stream) that looks like this: [ <-----json objects---->] [ <-----json objects---->] [ <-----json objects---->] How do you parse in Java? And is there a way to do it without rewriting the JSON data into a single array? Essentialy, I ...

Merging several MySQL results into a single JSON encode (PHP)

Here is code as exists now: while($row=mysql_fetch_assoc($count_query_result)) $output[]=$row; while($row=mysql_fetch_assoc($average_query_result)) $output2[]=$row; while($row=mysql_fetch_assoc($items_query_result)) $output3[]=$row; print(json_encode(array($output,$output2,$output3))); mysql_close(); My question: How do I take a single column from each of the three query results, and make a JSON array out of it, like so: [{ 'att1' : 'data'}, { 'att2' : 'data'}, { ...

Jackson - How to process (deserialize) nested JSON?

{ vendors: [ { vendor: { id: 367, name: "Kuhn-Pollich", company_id: 1, } ...

How to connect Javascript to Python sharing data with JSON format in both ways?

I'm trying to find out how to create a local connection between a Python server and a Javascript client using the JSON format for the data to be retrieved. Particularly, I need to make some queries on the HTML client side, send these queries to the server on JSON format ...

How to stylize recursive directory with css?

I'm trying to make a recursive directory display in html using json data from a node.js server and using it as the rendering context for a dustjs-linkedin template. The data contains a structure like the following: { "isDirectory": true, "path": "", "name": "", "files": [ ...

simplest solution for .net service to send mail securly?

whats the simplest method for creating a web service to send emails? I have a web app (static html pages) I want to upgrade to using web service of some sort along with some UI technology to communicate with the pages to the services. I want to know what are my options ...

Need to send json data from js to java

I have a JSON string in my javascript, I need to send this to a java class. Can I use a plain java class or is it necessary to use a servlet? Also, How can I parse the JSON data? My JSON data is of the following format: var details= ...

Check whether the JSON (object property exists) & print it as unicode decoded

I get the following data from the Instagram API, I m trying to get the text property from the caption using the following code: data = simplejson.load(info) # info is retrieved using the urllib2 for post in data['data']: ...

Html.Raw(Json.Encode and Internet Explorer 9

I use Html.Raw(Json.Encode in my Javascript to grab the contents of the ViewModel property passed to the View in my MVC 3 asp.net (razor) application as follows: var state = @(Html.Raw(Json.Encode(Model.State))); State is defined in my Model as such public class IndexViewModel { ...

Array of objects. JSON deserialization. Please suggest

I am consuming a web service which returns a JSON string. String str =[{"users":{"company":"abc","contact_Number":"999999999"}}, {"users":{"company":"xyz","contact_Number":"888888888"}}, {"users":{"company":"xxx","contact_Number":"555555555"}}, ] Unable to De-serialize. class jsonmenuwrapper { ...

JSON.net Deserialise Error - JSON string is valid

I hate to add to the 5,000+ JSON.NET deserialisation errors, but can anyone see anything that might be causing a problem in the following JSON below? Both JSONLint and JSONViewer state that the string is valid, indeed it has already been serialised by JSON.NET without any ...

The Jackson API and stack traces for infine recursion

I've noticed that the jackson API obfuscates an infinite recursion by wrapping, and displaying a "chain" that hints at the recursion, i.e. something along the lines of this: ArrayList[0]->"fieldX"->"..". I'm wondering what the advantage of doing this is? I recently had alot of trouble with an infinite recursion bug which would ...

FF SecurityError: The operation is insecure

My code suddenly stopped working after I updated ti IE9 , both IE9 and FF don't work. FF gives me "SecurityError: The operation is insecure" on the line data: JSON.stringify(someVar), When I am doing jquery ajax call $.ajax({ contentType: 'application/json, charset=utf-8', ...

How to easily send a POST request and receive + interpret JSON using PHP

I'm using the Foursquare API and I need to make a request to their server in order to receive an access token in JSON form (https://developer.foursquare.com/overview/auth). How do I do this using PHP? I haven't found any definitive tutorials online, which is why I'm asking here. I've seen some stuff ...

Convert a JavaScript Array into a JSON object

I'm modifying a Mail Merge project in Google Apps Script. The problem I'm facing is how to make the email body display inline images. Currently, all inline images present in the original email template are displayed as attachments after GmailApp.sendEmail() is called. My guess is that the inline images can ...

Creating and using streams in iOS 5

Bear with me please, I'm a new programmer. (things I say might not make sense) I'm trying to create an inputStream and outPut stream so that I can write to it using JSON objects elsewhere in the class... I wanted to know if I'm doing it right. Currently, I'm opening the streams ...

« Previous12345678910 ... 14021403Next »Show All