json

Spring-json problem in Liferay with Spring 2.5

Hi all, I am trying to use the library spring-json.1.3.1 in a project that has been done with Liferay 5.1.2 which includes Spring 2.5. Following the project website instructions, I managed to make the request hit in my controller, but at the moment of returning the json object back through the modelAndView object it fails with the foll...

JSON Parse Date Formats?

Am I correct in assuming that I have to MANUALLY convert Json-encoded date strings to date objects in my client code? Coming from C#, I took for granted that this was happening automatically, but I guess that was .NET. Is there a built in mechanism for getting native javascript types from a Json string (for dates, ints, etc.)? Thank...

IE: Passing value from JSON object to onClick event.

I'm using jquery ajax. The server returns a JSON object and I am fetching the array. Everything works fine in FF, of course, but somehow when i try to use this syntax: $('#edituserLink').attr("onClick","edit('"+user[0]['USER_ID']+"');"); the onClick function wont have the value as an argument. Why? ...

Help with IE bugs when writing JSON via an ASPX response

I have an ASPX page that I am using to write JSON. It works great in Firefox and Chrome, but when I try and use it in IE 8 it gives me an "The XML page cannot be displayed" error instead of allowing jQuery to load the JSON being written by the response. Any ideas? Here is what my code looks like: protected override void OnLoad(Even...

JSON.parse string with quotes

Hi, I've this: JSON.parse('{"130.00000001":{"p_cod":"130.00000001","value":"130.00000001 HDD Upgrade to 2x 250GB HDD 2.5\" SATA2 7200rpm"}}'); http://www.jsonlint.com/ says it's perfectly valid json. But on execution I have a JSON.parse error. But, if I change my code to: JSON.parse('{"130.00000001":{"p_cod":"130.00000001","va...

C++ JSON parser

Dear reader, I'm working on a twitter client which uses the twitter streaming json api. Twitter advices JSON as XML version is deprecated. I'm looking for a good JSON parser which can parse the json data below. I'm receiving this JSON which I want to be able to read/parse using a JSON parser. { "in_reply_to_status_id": null, "text": "...

Javascript: how to handle a next item in json - playlist

I have an application that creates a playlist of videos and returns them in json format, the video ID is the "key" and then it has video information attached to it. The video ID is not sequential, "1234", "4234", "123", "5454" are possible IDs, among others. I have a button for switching the next video, the problem is I don't know how t...

jQuery - consuming JSON resources - some return data, others don't. Why?

I'm trying to figure out how to consume json URLs in the browser and render the data in my web pages using DOM. I am not getting a consistent or predictable response. I found a JSON URL at Google Calendar which shows the json response in my browser if I just type the URL in the address bar. I found another JSON URL at business.gov whi...

JSON to PHP Associative array

Hey guys, would any of you know a good way to put this into an associative array . I have tried json_decode but found it to not be much help and: preg_match_all('|"name": "(.*?)",|',$json,$matches); Seems to match it (in expresso) but returns an empty array in php. This is the data i need to put into an associative array: { ...

Is there a way to graph with jQuery's flot with a data set that doesn't contain x values?

I have large amounts of data formatted in JSON formats, I recently scripted the data to conform to flot's data set, except for one problem, the data has no x values. EG: { label: "testMetric1", data: [12,314,123,41] } I want to simply graph these values as y values. is there a way to tell flot to just assume the x series will be seque...

asp.net WCF and JSON

I know returning types in a wcv service is allowed, and it will convert the object to json. But what if I don't want to return a random type, but return a string with formatted json? I can construct json my self but it can a) be messy, and b) not auto encode html values. How do I do build a custom formatted json string? Off the top of m...

YAJL-ObjC + Streaming Parser + gzip

I'm successfully using yajl-objc along with ASIHTTPRequest in an iPhone project that does network access and pulls down and parses JSON data. ASIHTTPRequest allows gzipped HTTP responses by default, which is great, but I'm using the streaming parser ability of YAJL and it rightfully chokes on gzipped data. I can wait until the HTTP requ...

problem in getting JSON data through server?

I am using Tropo Web API, to get result from a chat application, i redirected my JSON response to my server side PHP file(http://myhost.in/vj/app3.php?tropo-engine=json), the JSON response is coming correctly but i am not able to fetch data from that using PHP, the JSON response is as follows.. { "result": { "actions": ...

select box (combo) is not responding

Hello I am using following javacript code $("a.adminlink").click(function(){ $("#bigpopup").fadeIn(); //$("a.activetablink").removeClass("activetablink"); //$("a.tablink[href=" + $(this).attr("href") + "]").addClass("activetablink"); $.get($(this).attr("href"),{},function(response){ $("#tabmenu").html(response.menu); ...

Differences/Advantages of using JSON over XML or vice versa?

Possible Duplicate: When to prefer JSON over XML? i wonder if JSON is the preferred choice for AJAX transfers (if this is what its called) over XML? i see that usually JSON is used in jQuery docs over XML? ...

nothing (expecting JSON) returned from server?

i am trying to experiment with the tumblr api. i tried $(function() { $.getJSON("http://jiewmeng.tumblr.com/api/read/json", function(data) { $("#postsContainer").append(data); }); }); but got a 200 OK with empty response in firebug. when i navigate to http://jiewmeng.tumblr.com/api/read/json, i see the data. so i shld be g...

User Availability using jquery and json not working on server in asp.net

I have a textbox on blur function.I'm calling a Jquery function which work call a webmethod on the cs file returning true and false.I am using JSON.This whole functionality is working on local and when i give a alert(result.d).It gives proper result when working on the server i.e 0 or 1.But when i do that on server,it returns undefined.I...

How to pass data to JsonResult in ASP.NET MVC?

Hi, this must be a newbie question. I have this method in a controller: public JsonResult GetUpdates(string lastChatMessage) { var json = Json(new {lastModeratorAction = -1}); return json; } I am calling it with $.ajax or $.getJSON from Javascript. The method gets called but there is an exception somewhere. If I use $.ajax ...

Help on this code which tries to: Make a jQuery Ajax call to a webservice that needs to return JSON

Hello, Actually I am trying to learn jQuery Ajax calls to asp.Net webservices. I have been trying to call the webmethod below: public class Person { public string FirstName { get; set; } public string Id { get; set; } public string LastName { get; set; } public string Department { get; set;} ...

Returning raw json (string) in wcf

The title says it all. I want to build my own json, and have the service return a string, here is the code [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] public string GetCurrentCart() { //Code ommited string jsonClient = nul...