json

Native JSON support in iOS?

Is there a class to parse JSON from a server in the iOS SDK? (similar to NSXML for XML and by extension RSS.) ...

jQuery Ajax Calculator Issue

I'm having some problems displaying error messages that are being passed from a php file through an ajax request. The problem is when I receive less than 3 errors messages that are supposed to be displayed in an unordered list. I don't want to display any "undefined" variables - that's why I'm not adding them to the unordered list throu...

Understanding the basics of JSONP and Rails.

I'm having a tough time finding some basic information on the accepted way to do JSONP with my app... Let me explain, say I have an app (App A) that provides a response in json, how can I call that script using jQuery from a different site, and load that JSON data? I'm pretty sure I can just link to a JS file on app A and use that to lo...

Problem with JSON

var obj = { '51' : { 'name':'name1'}, '66' : { 'name':'name2'}, '58' : { 'name':'name3'} }; $(function() { s = ''; $.each(obj, function(k, v) { s += ' '+k; }); alert(s); }); In IE and Firefox it's 51 66 58, but in Opera and Chrome it's 51 58 66 Why Jquery.each() sort by key in opera, chrome? What can i...

php json_encode mysql result

I have a simple mysql_query and I would like to encode the results(title= > $title, price => $price etc) in json . $sql = mysql_query("SELECT * FROM item_details WHERE posting_id='$item_number'"); while($row = mysql_fetch_array($sql)) { $title = base64_decode($row['title']); $price = $row['price']; $seller_user = $row['user...

Storing Data in MySQL as JSON

I thought this was a n00b thing to do, and so i've never done it than i saw that FriendFeed did this and actually made their DB scale better and decreased latency. I'm curious if I should do this, and if so, what's the right way to do it? Basically, whats a good place to learn how to store everything in MySQL as a couchDB sort of DB. St...

jquey ajax post method to post the json data to particular url and retrieve in particular webservice

I have ajax request to post data to asmx webservice, how will i post multiple data values as json data to that url $.ajax( { type:"POST", url:"AjaxService.asmx/CheckUserNameAvailability", data:"{\"userName\":\"" + userName + "\"}", dataType:"json", contentType:"applic...

Using jQuery, JSON and AJAX to populate a drop down

Hi guys, like the title says, I am trying to create a drop down menu using jQuery, JSON and AJAX, although I am familiar with the theory I have yet to put it into practice, any advice, demo code snippets or tutorials would be appreciated, since I would like to get off to the best possible start! Thanx in advance! ...

placing the json data to sql database from webservice

This is the particular webservice code where i retrieve the username ,how i can i write c# code to place json data to sql database in webservice and display the acknowledgement in html page public class AjaxService : System.Web.Services.WebService { [WebMethod] public bool CheckUserNameAvailability(string userName) { ...

How to consume Rest API with complex objects using Httparty and Ruby

I am trying to implement call this API method in Ruby https://zferral.com/api-docs/affiliate#aff-create-usage-example which expects this object: { "affiliate" : { "email" : "[email protected]", "send_user_email" : "1" }} Using a Httparty class, I call this: result = self.class.post("/api/#{@apikey}/affiliate/create....

embedding html created by a perl method, in the place it is being called upon

Hi All, I am very new to perl coding, I am calling a method, which again calls some other method and then generate an html code. I need to embed the htmlcode in my current code, so as to add that to the current html code. I am calling the method like this my $test = $frek->xyz(); where xyz generated an html. now i need to embed the $...

Solr Mulivalued Problem

Consider The following is the json response i'm getting from the solr if i use multivalued = true for the fields. { "id":["1","2","3"], "TS":["2010-06-28 00:00:00.0","2010-06-28 00:00:00.0","2010-06-28 00:00:00.0"], "Type":["VIDEO","IMAGE","VIDEO"] } but i need the response like this { "0":["1","2010-06-2...

Trouble with jQuery getJSON

I am using the following URI like so to pass to jQuery's getJSON. var publicVidsUrl = 'http://api.publicvideos.org/v/0/clips?callback=?'; $.getJSON(publicVidsUrl, function(data){ alert(data.length); }); ...but it is failing. While the JSON returned passes as valid in JSON lint, I am not so sure. The escaped double quotes seem fi...

NoMethodError on standard Android runtime object

Heya, I get a very strange error that I just cannot sort out when attempting to serialize objects to JSON on all android platforms, from 1.5 through to 2.2 (both on phones and emulators). I receive this error: E/AndroidRuntime(21017): Uncaught handler: thread AsyncTask #2 exiting due to uncaught exception E/AndroidRuntime(21017): java....

getting null while trying to send and receive a form value using json and jquery

Hello all, Here's the HTML part that may be wrong perhaps on the form statement (not sure): <div id='data'></div> <form action=""> <input type="text" name="nomeInput" value="" /> </form> Here's the javascript part: $(document).ready(function(){ $.post("testeBasico_1.php", {nomeInput : $('#nomeInput').val()}, function(resposta)...

Ruby on Rails: Problem adding Transient Attribute to Object for JSON Serializaton

Hi everyone, In my Item controller, I wish to add a transient (i.e. non-persistent) attribute to my model object before rendering it as JSON. def show @item = Item.find(params[:id]) @item.comment = "some comment" render :json => @item end My Item class looks like this: class Item < ActiveRecord::Base attr_acc...

Serialize form to and from JSON

I want to serialize a form into json, process the json object, then reserialize it to send to a php script via ajax. Here is a rough example of what I want to do: s = $('.dia_req_form').serialize(); j = //convert s to json ...HOW?? if(j.name) { alert("you must enter a name"); } if(selectedID) { j.id = selectedID; } s = //serial...

Parsing JSON string with jQuery.parseJSON()

So, this should be simple in my mind... I have a valid JSON string being returned through an Ajax post: {"success":true,"message":"Thank you! We value your feedback."} And I'm simply trying to alert my "message" value onto my resulting post return: success: function (result) { alert(result); var obj = $.parseJSON(result); a...

Best practice to parse a JSON object on the client in Java & Android

In my Android client I want to receive JSON objects from a server. By googling I found a lot of different possibilities how to best parse the InputStream from the Server, but most of them wrote their own parser. Isn't there a library which does this parsing for me? Or how should I best implement it by myself? ...

virustotal.com API example in PHP?

Does anybody have a PHP example of using the VirusTotal.com public API for URL scanning? The API is available here: http://www.virustotal.com/advanced.html There's a Python/JSON example, but I'm not experienced with either :( ...