json

iphone Json POST request to Django server creates QueryDict within QueryDict

I'm creating a JSON POST request from Objective C using the JSON library like so: NSMutableURLRequest *request; request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@/", host, action]]]; [request setHTTPMethod:@"POST"]; [request setValue:@"application/json-rpc" forHTTPHeaderField:@"Content...

Prototypejs .evalJSON not returning object

I have this JSON (which validates according to JSONLint): [ { "BugCount":"2", "BugTitle":"C:\\INETPUB\\WWWROOT\\CLUBREADY2\\TRAINERS\\../Connections/LTC.asp", "ErrLine":"141", "BugID":"702" }, { "BugCount":"1", "BugTitle":"/admin/ajax_logagreementsig.asp", "ErrLine":"0", "BugID":"1322" }, ] However, whe...

Javascript + Pretty Print JSON

I'm looking for a jQuery plugin or a standalone script that will take a javascript object and create a navigatable tree like the FireBug plug in does. Does this exist, or will I need to write one? Googling hasn't found much yet. ...

Ajax post request, an object that includes an array and other objects, can't be parsed correctly into rails, if i do it with jQuery it works but i dont want jquery im doing it in native javascript.

what i want is to get a proper parameter, if you see the parameter been logged you would tell there is something wrong my javasript: first run the runMe function Ajax: function() { var xmlhttp, bComplete = false; try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHT...

jQuery UI Autocomplete formating help, (I'm new to jQuery)

I've been using this tutorial to make an autocomplete function. (UPDATE: I ditched the jQuery UI Autocomplete route because there isn't much documentation for it.) The following code works (FINALLY). I also managed to get the suggestion links to work as well. I plan to make some type of blog post to help other noobs like myself figur...

Rails Google Maps integration Javascript problem

update I Based on feedback, I've changed var maps to var adds. problem description I'm working on Rails 3.0.0.beta2, following Advanced Rails Recipes "Recipe #32, Mark locations on a Google Map" and I hit a road block: I do not see a google map. My @adds view uses @adds.to_json to connect the google maps api with my model. My databas...

Regex to validate JSON

I am looking for a Regex that allows me to validate json. I am very new to Regex's and i know enough that parsing with Regex is bad but can it be used to validate? ...

DataContractJsonSerializer ReadObject Exception

I am following the accepted answer of ASP.NET MVC How to pass JSON object from View to Controller as Parameter. Like the original question, I have a simple POCO. Everthing works fine for me up until the DataContractJsonSerializer.ReadObject method. I am getting the following exception: Expecting element 'root' from namespace '...

What does this javascript do?

I was adding recent videos gadget on my blog. In that widget i was supposed to add this line <script src="/feeds/posts/default?orderby=published&alt=json-in-script&callback=showrecentpostswiththumbs"> also, i added another script which was having the method showrecentpostswiththumbs [ used in callback ]. Please let me know what does ...

cannot display json data returned from jquery ajax call

Hi, can somebody please tell me, how can I display json data returning from the ajax call. I am new to this. $.ajaxSetup({ cache: false, timeout: 5000 }); //String.prototype.toJSON; var the_object = {}; function concatObject(obj) { strArray = []; //new Array for (prop in obj) { strArray.push(prop + " value :" + obj...

Adding property:value pairs from GooglemapsAPI to an existing json/javascript object

I am trying to create a script that finds the closest store/location to a customer using googlemapsAPI. So I've got a json object which is a collection of store objects. Using Jquery's .each to iterate through that object, I am grabbing the driving time from the customer to each store. If it finds the directions, It copies the duration o...

Convert non-breaking spaces to spaces in Ruby

I have cases where user-entered data from an html textarea or input is sometimes sent with \u00a0 (non-breaking spaces) instead of spaces when encoded as utf-8 json. I believe that to be a bug in Firefox, as I know that the user isn't intentionally putting in non-breaking spaces instead of spaces. There are also two bugs in Ruby, one o...

Is it possible to make JSON requests using Fiddler's Request Builder?

I keep getting a Request format is invalid. Here's the raw http that get's sent: POST http://x.x.x.x/ws/MyWebService.asmx/TestEvent HTTP/1.1 contentType: "application/json; charset=utf-8", dataType: "json", data: {"strData":"1"} Host: x.x.x.x Content-Length: 4 Any help is greatly appreciated. Thanks! ...

Android - Calling getJSONArray throwing JSONException with no stack trace

Hi all, I'm currently working on an android app that pulls a list of forums from a JSON feed. I'm trying to parse the feed and immediately upon calling getJSONArray a JSON exception is being thrown with no stack trace. The JSON being returned is stored in an JSONObject jobj with the format as follows: { "Forum": [ ...

AjaxFileUpload return download panel when data is json

I use AjaxFileUpload (http://www.phpletter.com/Our-Projects/AjaxFileUpload/ ) to upload a file and get json result type response in struts2 ( code.google.struts2jsonresult.JSONResult ) but browser always pop-up download pane, plz give me some suggestions, thanks in advance Here is my config in struts.xml : ...... <result-type name="j...

How to parse JSON in Java

I have the following JSON text that i need to parse to get pageName, pagePic, post_id, etc. What is the required code? {       "pageInfo": {            "pageName": "abc",            "pagePic": "http://profile.ak.fbcdn.net/object2/367/65/q160119538822_4127.jpg"       }       "posts": [            {         ...

Json with struts2, How to populate this object?

I have this question: How to populate this object from a struts2 action. My action populates without any problem a lot of my objects, but I have a restriction on a JSON input. My input is like this: I don't now how to populate...The class geometry can have a double[] or double[][] or double[][][] because the JSON input can have multip...

Get json from Twitter API in iPhone using JSON Framework

Hello now I'm trying to get json data from Twitter API using iPhone. I'm using JSON Framework. This code has good results. #import "JSON/JSON.h" NSString *urlString= @"http://api.twitter.com/1/statuses/public_timeline.json"; NSURL *url = [NSURL URLWithString:urlString]; NSString *jsonString = [NSString stringWithContentsOfURL:url encodi...

LitJSON specify which object properties need to be mapped to Json

I'm using LitJSON. I have a List of objects that I need to convert to Json but I don't want to map all the properties of the object just a select few. Is there a way to specify which properties I want to convert to json? ...

How to decode an array of json object

I have an array of json objects like so: [{"a":"b"},{"c":"d"},{"e":"f"}] What is the best way to turn this into a php array? json_decode will not handle the array part and returns NULL for this string. ...