json

Calling ASP.NET ASMX Web Service from jQuery

I am trying to call an ASMX from jQuery using JSON and get a SOAP error response. What am I doing wrong?! This is my jQuery call: $.ajax({ type: "POST", url: '/Services/TeamPerson.asmx', contentType: "application/json; charset=utf-8", data: {'active':false, 'team_id':team_id, 'player_id...

Bottle and Json

How do I go about returning json data from a bottle request handler. I see a dict2json method in the bottle src but I am not sure how to use it. What is in the documentation: @route('/spam') def spam(): return {'status':'online', 'servertime':time.time()} Gives me this when I bring up the page: <html> <head></head> <bod...

How do I get an item from a JavaScript object?

How do I get an item from a JavaScript object: var items = [ { ITEM:1, AMOUNT:10 }, { ITEM:2, AMOUNT:20 } ]; I want to be able to do something like this: $(items).filter(ITEM == 1).AMOUNT; ... which would return 10. ...

Iphone programming IOS4 - add video to HTML code in JSON wrapper

Hello, I am writing an application which is based in HTML and has a JSON wrapper in the app. After the 4.0.2 update the iphone does not play video files properly anymore. All the code to play video files is based in HTML but after the update it shows the play button only and I can not click on the video to play it. The file is loca...

jQuery, JSON, searching, etc.

I've got a mass of values in a JSON file containing the names of venues and their contact information along with a description. I'd like to generate a table listing the contents of the JSON file on my page. I'm hoping to create a live search function that removes each entry that is no longer relevant with eachkeyUpdetected. The JSON [ ...

parse json in jquery

$.ajax({ url: 'contact', type: 'post', asynch: 'false', dataType: 'json' , data: "recaptcha_challenge_field=" + $("#recaptcha_challenge_field").val() + "&recaptcha_response_field=" + $("#recaptcha_response_field").val() , success: function(data) { alert(dat...

Define dynamic JSON-Array

Hey, i've got a new problem. I know how i have to define a static JSON-Array, but now i must make this dynamic so i could add items with a loop. this is the static version: $json = array(array('field' => 'name', 'value' => $name), array('field' => 'nummer', 'value' => $numbers));...

Working and tested JSon serializers for .NET 4?

Entire question is in the title: Are there any working, and tested, JSon serializer implementations for .NET 4? I tried Json.NET on codeplex, but it is neither updated for .NET 4.0, nor does it handle culture differences (like comma/dot in floating point values). Are there any that works? ...

Fastest JSON reader/writer for C++

I need C++ json parser & writer. Speed and reliability is very critical, I don't care if interface is nice or not, its Boost based or not, even C parser is also fine (if its considerably faster than C++ ones). If somebody has experience with speed of available JSON parsers, please advice. ...

How to rebuild my class hierachy with Json.NET?

I have a simple class hierachy. Foo is the base class. Bar and Baz are inherited from Foo. Instances of these classes are stored in a List. I have to serialize the list to JSON. It works pretty well. But the problem is deserialising it back into a List<>. I put Foos, Bars and Bazs in the list, serialize it and when I deserialize it I ge...

Can't turn array into a string error

I have a simple call JSON.parse(Panda.get("/videos/#{self.panda_video_id}/encodings.json")) Which returns : can't convert Array into String This is because the Panda.get("/videos/#(self.panda_video_id}/encodings.json") call returns an array in the new Panda 1.0.0 gem. I also tried : JSON.parse(Panda.get("/videos/#{self.panda_vi...

Basic jQuery with JSON Parsing

Hello, I am trying to parse some very basic JSON, but I don't know where I'm going wrong when trying to display it to the screen. Am I not GRABBING the data correctly, such as, "data.re1Code"? I hope someone can shed some light onto my basic question sorry. JSON Data [ { "rep1FullName": "Justin Giesbrecht", "rep1C...

Post JSON using Curl

Hi Everyone! I am receiving a JSON which I can receive using php://input and I need to post it back to a different URL, but I'm not sure how to format it. Here's how I receive it: $updates = file_get_contents("php://input"); I could json_decode it and then parse out the array so that it would fit a normal POST-like request such ...

TreeLoader: Not firing ajax request for child nodes?

Ok so, i have this site that i am putting together in the play framework. It basically connects to an FTP site on the back end, retrieves a list of folders/files and sends that to a basic ExtJS front-end as JSON. I have it working so that the Tree Panel gets populated correctly, but it doesn't seem to be doing anything special when i e...

Javascript: How to generate formatted easy-to-read JSON straight from an object?

Hi all. I know how to generate JSON from an object using JSON.stringify, or in my case the handy jquery-json from google code (http://code.google.com/p/jquery-json/). Now this works fine, but the output is hard to read for humans. Is there an easy way / function / whatever to output a neatly formatted json file? This is what I mean...

How can I access an object property named as a variable in php?

A Google APIs encoded in JSON returned an object such as this [updated] => stdClass Object ( [$t] => 2010-08-18T19:17:42.026Z ) Anyone knows how can I access the $t value? $object->$t obviously returns Notice: Undefined variable: t in /usr/local/... Fatal error: Cannot access empty property in /.... ...

JSON object value based on other object value

I need to find a value based on another object value json = {[{ID:"1",city:"Atlanta"},{ID:"2",city:"New York"}]} and so forth. I need to find the value of a city where ID is x. Is there anyway to do it without using loops? More Details: I have to create a json object looping thru the document, then I send this json to the webservice...

Character indices of a string containing unicode characters

I'm linkifying @mentions in status messages returned by Twitter's API. One of the tweets has a unicode character in it. Parsing the JSON (with either the json gem's JSON.parse or ActiveSupport::JSON.decode) returns a string that displays correctly, but the indices for the start and end of the @mention specified by the entity don't ma...

How to Get A JavaScript Variable Value from Inside a Function?

I'm using the JQuery getJSON function to get some JSON-formatted data. The data will be used along with the YouTube JavaScript API: http://code.google.com/apis/youtube/js_api_reference.html The JSON data is not pulled from YouTube. It's a simple, hand-written list of YouTube Video ID's and Titles which are listed on a CSV. I'm using PH...

Json contentType: breaks Jquery POST to MVC controller

I'm was trying to fill in a description field when a drop-down was selected. I Got it working but I couldn't use a Json Content Type. This works <script type="text/javascript"> $(document).ready(function () { $("#ddl_id").change(function () { var test = $("#ddl_id").val(); $.ajax({ typ...