json

jQuery plugin question - populate select options with JSON data

I'm trying to fill selects with json data from a web service. I'm getting error 'Object doesn't support this property or method.' when I do this $(this).html(options.join('')); Any ideas what I'm doing wrong? ;(function($) { $.fillSelect = {}; $.fn.fillSelect = function(url, map) { var jsonpUrl = url + "?callback=?"...

How to call Json objects dynamically?

Hi, I have like this var house = {'floor':{'one':'3 people','two':'1 people'}} var tmp = 'one'; and I want to call like this.. console.log(house.floor.tmp) // expecting '3 people' result tmp value will get from somewhere dynamically but it's not working. How can I solve this? ...

invalid property id error while passing data in json format

I have a some data in JSON format(which comes from php) to be passed to a javascript function. I'm getting 'invalid property id' error when I try to do this. Error: invalid property id Source File: http://localhost/MathVoyager/index.php/test Line: 1, Column: 15 Source Code: draw_quadratic({ Below is the js function signature(both data...

Yahoo Pipes 'failed to parse input' XML

Hello, I'm having a slight problem with Yahoo Pipes, when i enter the url: Umstant i get an error 'failed to parse input'. I think the problem is because the XML isn't being transmitted with the xml declaration: <?xml version="1.0" encoding="utf-8"?> I've asked the author to add it but it seems to break other things in the process, s...

Deserializing JSON in WCF throws xml errors in .Net 4.0

Hi there. I'm going slidely mad over here, maybe someone can help me figure out what's going on. I have a WCF service exposing a function using webinvoke, like so: [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, RequestFormat = WebMessageFormat.Json, Respo...

Trouble correctly formatting NSString for JSON.

Having a little trouble processing my NSStrings into a valid JSON string. NSString *version = @"1.1"; NSString *callMethod = @"auth.login"; NSString *paramsConfig = [NSString stringWithFormat:@"{\"email\":\"%@\",\"password\":\"%@\"}", usernameString, passwordString]; int queryId = arc4random()% 10000000; NSDictionary *us...

Jsonp request using jquery to fetch bing web results

using this as a guide: http://msdn.microsoft.com/en-us/library/dd250846.aspx can someone help me with the jquery call? Do I actually pass in the javascript code for the callback, or just the name of the function? BingSearch = function($bingUrl, $bingAppID, $keyword, $callBack) { $bingUrl = $bingUrl + "?JsonType=callback&JsonC...

Matching a value to JSON array values in jquery

I have a JSON array that looks like this: ['Monkey','Cheetah','Elephant','Lizard','Spider'] I also have a text input. I want to test whether the value of the input upon 'blur' is also in the array and if it is do something. Knowing a bit of python I tried something like this: var existing_animals = ['Monkey','Cheetah','Elephant','Li...

Use queried json data in a function

I have a code similar to this: $.ajax({ success: function(data) { text = ''; for (var i = 0; i< data.length; i++) { text = text + '<a href="#" id="Data_'+ i +'">' + data[i].Name + "</a><br />"; } $("#SomeId").html(text); for (var i = 0; i< d...

python parsing file json

File json: {"maps":[{"id":"blabla","iscategorical":"0"},{"id":"blabla","iscategorical":"0"}], "masks":["id":"valore"], "om_points":"value", "parameters":["id":"valore"] } I write this script but it only print all the text. json_data=open(file_directory).read() data = json.loads(json_data) pprint(data) How can I parse the file and ...

Smart or Not: Persist serialized data (dotnet-protobuf, protobuf-net, json) in a Relational DB in CF

I have started reading some of the posts related to protocol buffers. The serialization method seems very appropriate for the transfer of data to and from web servers. Has anyone considered using a method like this to save and retrieve data on the mobile device itself? (i.e. a replacement for a traditional database / orm layer) We curre...

jQuery AJAX PHP JSON problem

Hi Gurus I'm facing the problem of receiving an empty array when I do an AJAX request in the following way: This is the code I'm executing in JavaScript: <script type="text/javascript" src="lib/jquery.js"></script> <script type="text/javascript" src="lib/jquery.json.js"></script> <script type="text/javascript"> $(document)...

Does to_json require parameters? what about within rails?

Does to_json require parameters? what about within rails? I started getting the error "wrong number of arguments (0 for 1)" when doing myhash.to_json Unfortunately I'm not sure when this error started happening, but I guess it relates to some versions of either rails or the json gem. I suppose my code (in a rails controller) is using t...

PHP/json My field names are being truncated to 30 characters. Can I stop this?

Hi Everyone! Ok so I got this piece of vendor software that they said should be run on an apache php server and MySql database. I didn't have either of those so I put it on a PHP IIS server and I converted the code to work on SQL server. ex. mysql_select_db -> mssql_select_db (among other things) So I have the following code in a php...

Writing JSON with XSLT

Hi, I'm trying to write XSLT to transform a specific web page to JSON. The following code demonstrates how Ruby would do this conversion, but the XSLT doesn't generate valid JSON (there's one too many commas inside the array) - anyone know how to write XSLT to generate valid JSON? require 'rubygems' require 'nokogiri' require 'open-uri'...

Thrift supports JSON in C++ and Java, is C# support floating around somewhere?

As the question asks, is there any know C# support for writing (don't care about reading) JSON via Thrift. ...

Callback function doesn't work when using getJSON

Hi, This is the code that I am using, When I write the link into the browser (I.E. or Mozilla) it is working like (MyFunc({"memes":[{"source":"http://www.knall......), but when I try to run it as HTML file I have a error in status Bar. what is the problem?. Thanks <head> <style>img{ height: 100px; float: left; }</style> <scri...

Why a wrong tweet id is returned from twitter API?

Hello. I use twitter API to retrieve the user home timeline tweets. I use json response format. Recently the tweet id (in API it is just 'id') are retuned wrong. As an example normally it should return like this: "id": 14057503720, (example is from twitter console) however at my request it is returned like this: "id": 1172601832 It ...

RDF/XML format to JSON

I am trying to convert the RDF/XML format to JSON format. Is there any python (library) example that i can look into for this to do ? ...

Receive JSON payload with ZEND framework and / or PHP

I'm receiving a JSON payload from a webservice at my site's internal webpage at /asset/setjob. The following is the JSON payload being posted to /asset/setjob: [{"job": {"source_filename": "beer-drinking-pig.mpg", "current_step": "waiting_for_file", "encoding_profile_id": "nil", "resolution": "nil", ...