json

Question about json_encode and two dimensional array

Hello everyone, I have a problem when i use json and array. And i need your help. Here is my code: while($row = mysql_fetch_assoc($result)){ echo json_encode($row); } The result is: {"id":"1","title":"event1","start":"2009-11-10 14:18:15","end":"2009-11-03 14:38:22","allDay":"false","url":null}{"id":"2","title":"event2","start":"20...

Parse this JSON file using JQuery

This is the JSON I found whilst trawling the BBCs API site http://cdnedge.bbc.co.uk/nol/ukfs%5Fnews/hi/front%5Fpage/ticker.json I'd like to turn these entries into an ordered list in the form of <div id="news"> <ul> <li><a href="'http://news.bbc.co.uk'+ entries.url +"><span class="+isBreaking+" entries.headline</span></a></li>...

Good JSON Java Library?

Can anyone post feedback on their experiences with various json libraries for java? In particular, does anyone have feedback on their experience with Google-gson? (I'm aware that there's a nearly identical question here, but that's over a year old, so people may have different experiences now.) ...

Sending $.getJSON to external server

I was told that $.getJSON is the best way to send data to and from external servers. I probably wasted 7 hours of my time trying to use JQUERY's Ajax to do so just to find out that no browsers allow that type of method. I would like to send the data using the Jquery getJSON and I am using cakephp as my receiving end (i.e. My external se...

Calling wcf rest service from jquery doesn't work

I have written a really simple wcf rest service which seems to work fine when I make requests to it through fiddler but I cannot get it to work when calling it from JQuery. Service: [ServiceContract] public interface IService1 { [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "customers/{regionId}"...

how can I convert a string (json) to look like another string

Hi, I have an json output of the following (ignore the escape characters) "{\"sEcho\":1,\"iTotalRecords\":10,\"iTotalDisplayRecords\":10,\"aaData\":[{\"Job\":\"developer\",\"Name\":\"kurt\"},{\"Job\":\"plumber\",\"Name\":\"john\"}]}" which i get from Person person = new Person(); person.Name = "kurt"; person....

Android: SearchBox -> fill hint list dynamically with data received via HTTP/JSON

I've been looking into the Android SDK's example of the SearchableDictionary for a while now, but I'm still not sure if that is the right approach. The problem is, that I want to fill my hint list (see picture below) with data, which I will receive via a HTTP/JSON query. So I'm not sure if using a ContentProvider as used in the above ex...

Can silverlight serialize annonymous objects?

Can silverlight 3 serialize annonymous objects? ...

How to return JSON from ASP.NET .asmx?

I have the following test method: Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols <WebService(Namespace:="http://tempuri.org/")&gt; _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <System.Web.Script.Services.ScriptService()> _ Public Class DemoService Inherits System.Web.Serv...

ASP.NET MVC - Build Search Results into a Div

I'm new to ASP.NET MVC, but I need to perform a search for articles that match a selected category. The results of this query need to be written into a "search results" div overlay with DHTML- jquery, probably. So, I need the results of an Action, but not to render a view. I was thinking I could use Json and then iterate over the res...

JavaScript: How do I create JSONP?

I have a two domains, example1.com and example2.com From example1.com, I would like call a JSON API I have on example2.com. Knowing that this is not allowed, it occurred to me - this is exactly why JSON**P** was created. Question is, how do I modify my JSON API to make it JSONP capable? Basically, how do I create the callback api? UP...

JSON response not working?

I'm new to JSON/jQuery, and I'm trying various JSON-AJAX examples. Unfortunately, my simple code doesn't seem to be working. Here is my JS/jQuery in testjs.js: $(document).ready(function(){ $("#radio").click(function () { $.getJSON("testphp.php", { testtest: 'blah' }, function(data){ alert(data.response); }); })...

How to reload the Jsonstore results onto panel?

Hi, I am able to create a json response like this: {"total":2,"results":[{"id":1,"checkList":"Item1","checkStatus":"Available"},{"id":2,"checkList":"Item2","checkStatus":"NoStock"}]} I have also created a function and embed it to the listener on the Jsonstore. The function will loop through the available results and embedding in pane...

JQGrid Not Completing

I am attempting to use jqGrid with asp.net. The grid comes back greyed (disabled?) and the Loading... div is still visible. But my data is in the grid just fine. From reading other questions and forums my problem is being caused by something I have set wrong. I'm hoping someone can look at my code and my json response and point me in t...

Need Ajax Json submission to allow single and double quotes

I have this where edit_FName & edit_LName represent asp.net textboxes: $.ajax({ type: "POST", url: document.URL + "/EditName", data: "{fName:'" + edit_FName.val() + "'" + ",lName:'" + edit_LName.val() + "'}", And I need it to allow for both single and double quotes in the names. I...

Simulating a form POST to ASP.NET MVC with javascript

I've had problems trying to send JSON to ASP.NET MVC Controllers. I don't want to accept one string parameter on each controller method and deserialize manually. I have found that constructing a collection of post variables works reliably, but I don't have a generalized function to do so. I can write one myself if no one has done it a...

How to do Ruby object serialization using JSON

I have a structure of simple container classes like so (in pseudo ruby): class A attr_reader :string_field1, :string_field2 ... end class B attr_reader: int_field3, :string_field4 ... end # C includes an instance of A and B class C attr_reader: :a_instance, :b_instance ... end Is there are simple way to de/serialize this...

How to pass JSON array correctly?

i am trying to create a fade effect with the following...ive been told im nearly there apart from the passing of the json array. At the moment no images are displayed. //generate all the boxes $.get('images.php',function(data){ for (var i=0; i < totalBoxes; i++){ var randomImage = data[Math.floor(Math.random() * data.length)];...

Webservice to convert file to base64 string

Is there a webservice available that will take a url of a file e.g. http://example.com/images/image.jpg and return a base64 encoded string of that file preferably in json format? ...

PHP - regex to reformat JSON

Hi, I've been trying to figure out how to reformat multiple JSON files into a single one using php, but am having a difficult time understanding how to use complex regular expressions. Suppose I hade multiple instances of the following JSON data: { "felines": { "cats": [ { "age": 7, ...