json

Passing a JSON object through POST using Python

I'm trying to post a JSON object through a POST. I'm trying to do it as follows: import json, urllib, urllib2 filename = 'test.json' race_id = 2530 f = open(filename, 'r') fdata = json.loads(f.read()) f.close() prefix = 'localhost:8000' count = 0 for points in fdata['positions'].iteritems(): print '--' + str(count) + '--------' ...

Ajax: Json vs XML

With the exception of needing an XML file, is there a benefit to using XML over JSON? JSON seems like an easier way to handle a return but I have very little experience using one or the other ...

What JSON does this CF code return?

Trying to implement the excellent jQuery bidirectional infite scroll as explained here: http://www.bennadel.com/blog/1803-Creating-A-Bidirectional-Infinite-Scroll-Page-With-jQuery-And-ColdFusion.htm For the server-side, which returns JSON, the example is in ColdFusion. Trying to implement it in PHP. I need to find out what the format ...

jquery ajax call to JsonResult controller method results in 404 on IIS6

I've been pulling my hair out this morning trying to figure this out. I have a simple jquery json request to a jsonresult action on my controller. When I run this on my local machine (IIS7), it works fine. When I deploy to a dev machine running IIS6, I get a 404 error. script: $(function() { $('#search').click(function() {...

deserializing date in jackson

I have a date in a json string (returned from an ASP.NET rest service) that looks like this: "created": "/Date(1277931782420-0700)/" Jackson is not able to parse this date. I can write my own date format and pass it in to mapper.getDeserializationConfig().setDateFormat(); but i was wondering if there is an easier/better way to do this....

Rails, AJAX, and jQuery..just add water?

Excuse my daftness, but I can not understand how ruby vars can be attained with jQuery. I made a button that by json POSTS to the server to make a credit_status = 0. But I would like that 0 to also auto-update on the page as well. My View: HQ $ = organization.total_credit = link_to 'redeem', redeem_admin_organization_path(organization)...

jquery json problem

look at this function please $(".menu_tree img.edit").click(function() { id = this.id; lang = '<?=$lang_id?>'; var body_width = $("body").width(); var body_height = $("body").height(); $("#shadow").width(body_width); $("#shadow").height(body_height); $("#shadow").show(); ...

Create tree hierarchy in JSON with LINQ

I have a flat list of some names in a random order. Is it possible to write a single LINQ statement to create a tree hierarchy in JSON so that they would be grouped according to the rules illustrated by the example below: Input: "Banana", "Apple", "Cheery", "Lemon", "Orange", ... Output: { "A, B, C": "Apple, Banana, Cherry", ...

How to use a JSON literal string ?

Since the JSON format specifies that single quotes should not be escaped, most libraries (or even the native JSON parser) will fail if you have an escaped single quote in it. Now this usually is not a problem since most of the time you do an XHR that fetches some data formatted as JSON and you use the responseText which contains your JSO...

create JSON object using variables for property name

Is it at all possible to use variable names in JSON properties for JSON object ceration? Example CreateJSON("myProperty"); function CreateJSON (propertyName){ var myObject = { propertyName : "Value"}; document.write(myObject.popertyName); // prints "value" document.write(myObject.myProperty); // Does not exist } ...

My jQuery enabled form does not submit when I typed in html tags in the textarea?

I have simple form with a textarea and a button, and I submit the form with jQuery .post() function and in 'json' format. My form submits correctly until I wrote some html tags like bold etc. in the textarea, then the form dose NOT sumbit to server anymore. I don't know what is wrong with what I'm doing and how do I get html segments s...

Parsing JSON with Python

I'm getting an error while parsing a JSON response in Python. Ex: { "oneliners": [ "she\'s the one", "who opened the gates" ] } The JSON decoder coughs up on the invalid escape on the single quote. Typically do people apply a REGEX to remove the escape slash character prior to decoding a response that can poten...

How can I remove some useless text in a json request with jQuery?

I am doing a json request on what appears to be a Facebook API page. However, the json is prefaced with for (;;); which is ruining jQuery's attempt to process it. How can I slice off these unwanted characters? Can I use the dataFilter property of the $.ajax call? My test code is: $.ajax({ url: 'http://www.facebook.com/ajax/typeahe...

ASP.Net Webservice Serialization

Hi All, Could someone here point me in the right direction about how I can override the serialization that occurs when my webservice is called? Basically the end result I am aiming for is appending a TIMESTAMP to all objects returned from my webservice but only when the JavascriptSerializer is being used in my webservice as opposed to ...

JSON Parser error.

Hi Everyone, I am using the json parser from json.org to handle data from my application. The problem is that the parser cannot handle some json formats. One request receives the data below. <?php $obj = array("cities"=>array("city1","city2","city3","city4","city5")); echo json_encode($obj); ?> Results in the json below ...

How do I use a JS variable within JSON?

I'm attempting to create a postcode lookup JQuery script that'll be able to be used multiple times on a page, without having to duplicate the script for every address on the page. The Find button has the class "postcodeLookup" and the attribute "address" which is how I intended to get the script to populate the right address (it uses JQu...

Jquery Ajax image load works only after alert statement is inserted in $(window).one function

Hello, I have a peculiar problem. I am loading a JSON file that contains the src, width and height of a number of images. I am trying to load them into the smooth script jquery plugin and have the images scroll automatically. The "viewing area" div can fit three images side by side. When I first load the page, only the first image is ...

how to invoke/consume Java restful web service in ASP.net 3.5 using C#

asp.net 3.5, but the webservice is designed in java and produces JSON. I want to get and post data to the database through the webservice. All the articles i found so far use soap but can anyone please tell me how to invoke/consume Java restful web service in ASP.net 3.5 using C# And i also would like to know if is possible to bind a...

Json - Mysql Charset Problem

I convert my php array to json using json_encode, Than I record this json data to my database .While json_encode encodes my data , It also converts strings to utf8 , this changes special characters to something like '/u011f' or '/u0131' . But when I write this converted data to mysql database , Backslashes are disappearing in field, so ...

Why are null strings in my database not returned with returnFormat = JSON

{ MESSAGE = LoginWelcomeBackMessage; SUCCESS = 1; USER = { AcceptAllFriendRequests = 0; CreateDate = "June, 07 2010 00:00:00"; DayOfBirth = "April, 24 1974 00:00:00"; UserName = "Erik Madsen"; }; } My CFC defines all the columns in my database table, but when a column is NULL, the field isn't returned as a property ...