json

How Do I Make Json.NET the Default Json Serializer

If I have a web service (.asmx) and I want it to use Json.NET to serialize all the objects that I return from that web service, is there a way to do that? In other words, I have a class like this: [JsonObject(MemberSerialization.OptOut)] public partial class Person { public string FirstName {get; set;} publ...

C#.NET Webservices using HTTPGET Returns System.IndexOutOfRangeException

I've setup this example web service to investigate the source of my error: namespace userControlPanel.webservice { /// <summary> /// Summary description for WebService1 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Compone...

Why is it called BSON?

So BSON is JSON serialized right? {"hello": "world"} → "\x16\x00\x00\x00\x02hello\x00 \x06\x00\x00\x00world\x00\x00" But why is it called Binary Json? What does binary stands for? I always tend to associate binary with 10101010101. But the BSON serialization format above wasn't in 101010101010 form. Could someone explain for me ...

ajax jquery post method

i have ajax request to url DataProcessor.aspx like shown below ,how can i write asp.net c# code to extract the json data from request and display in DataProcessor.aspx page var json = "{'ItemName':'" + escape(item.val()) + "','CategoryID':'" + category.val() + "','RecordID':'" + record.val() + "'}"; alert(escape(item.val()))...

Parse Json to Java bean

Hi! I am trying to parse a Json file like this, generated by Exiftool: [{ "SourceFile": "videos/XaviHernandez.flv", "ExifTool": { "ExifToolVersion": 8.22 }, "System": { "FileName": "XaviHernandez.flv", "Directory": "videos", "FileSize": "16 MB", "FileModifyDate": "2010:06:17 09:57:21+02:00", "FilePermissi...

PHP decode nested JSON

I've a nested JSON code as (it's actually my facebook status updates) { "data": [ { "id": "1290561400000000", "from": { "name": "My name", "id": "500920000" }, "message": "Message body", "updated_time": "2010-08-24T08:22:13+0000", "comments": { ...

Get Facebook events with Python

Any suggestions on how to get events from Facebook connected to a user in JSON with Python? All documentation seems to be directed against building Facebook applications. My goal is to show an events listing on a web page. ...

Json callback problem

I'm trying to get a greasemonkey's script to work jquery and json. this is the json url http://www.sora101.net/auction.php?id=1&amp;callback= this is part of the script $.getJSON("http://sora101.net/auction.php?id=1&amp;callback=?", function(data){ alert(data.id); } ...

Json parsing F#

Hello, #r@"\.NETFramework\v4.0\Profile\Client\System.Runtime.Serialization.dll" open System.Runtime.Serialization open System.Runtime.Serialization.Json [<DataContract>] type geo = { [<field: DataMember(Name = "type")>] t:string [<field: DataMember(Name = "coordinates")>] coordinates:string }...

jQuery AJAX URL Shortener JSON request not working

I'm stuck - and it's pretty frustrating for something I thought was going to be simple :( Jquery: $.ajax({ url: "http://ur.ly/new.json?href=http://www.yahoo.com"), type: "GET", dataType: "jsonp", success: function(data){ console.log(data); }}); I've tried doing this, and FF gives me an "invalid label" error, Chrome gives anoth...

Java ME consuming .NET Web Service the safe way

Hi Gurus I'm developing an application for Blackberry that consumes .NET Web Services that are hosted on our public web server. We are using JSON as our data interchange format. So far we have been testing the application and everything is working fine but there is one big thing to solve: the .NET web services are public. If you go to...

non-recursive JavaScript JSON parser

I have a very large JSON string that I need to parse with in-browser JavaScript. Right now, in a few browsers, I run out of stack space. Unfortunately, my JSON can contain user strings, so I can't use eval or otherwise let the browser parse it. I've looked at a few of the standard JavaScript JSON parsers, and they are recursive. Wonde...

how to get html code from cross domain

How to get html code [ complete div code ] from cross domain. I heard that we can get by using jquery, Ajax, Json concepts. I tried to research on these. But i dint understand how to access. Please give any simple example. I need to know atleast small information. Thanks in advance ...

JSON push not working from ascx

Hi I have a json object that i have declared in the master page. I want to push few elements in it from the ascx controls that are loaded For. e.g. Master page em = { d: [ { ID: "txt_Username", HelpID: "1" } ] } em.d.push({ ID: "txt_StatusUpdate", HelpID: "3" }); em.d.push({ ID: "txt_textarea", HelpID: "4" }); This...

How to initialize a javascript variable using Json String in Asp.net MVC?

I have the following Action method. public ActionResult Action() { var model = new SampleViewModel(); model.JsonString = ReadJsonStringFromSomewhere(); return ViewResult(model); } In my view I have the following method to initialize a javascript variable. <script type="text/javascript"> var jsObject = eval("(" + <%= Mod...

I would like json_encode in PHP to return a JSON array even if the indices are not in order...

but according to this: http://www.php.net/manual/en/function.json-encode.php#94157 it won't. I'm using flot so I need to have an array with numeric indexes returned but what I'm getting is this: jsonp1282668482872 ( {"label":"Hits 2010-08-20","data":{"1281830400":34910,"1281916800":45385,"1282003200":56928,"1282089600":53884,"1282176...

how to insert some markers (json format ) to map using google maps v3 .

i follow this article i find can use kmllayer to insert kml or georss , like this : var myLatlng = new google.maps.LatLng(49.496675,-102.65625); var myOptions = { zoom: 4, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var georssLaye...

How to parse an object to JSON using jQuery?

I know to use eval() to parse JSON to an object, but how do I parse an object to JSON format using JavaScript? Thanks. ...

Google Maps http request not working

I am trying to use an http request to google maps to obtain the driving distance between two locations using JSON. However, it seems these are treated different in a browser than in the (iphone) app. I create an NSString which holds the URL, using coordinates and %20 (a space). I NSLog() the URL to make sure, and it seems ok (ie it work...

jQuery JSON Callback says 'Undefined'

I'm creating this script which loads the data from JSON which is encoded in a PHP file (the JSON is valid). When a div is clicked on, it should show the data from the jQuery, which is done here: function quickView(pid) { $.getJSON('project.php', { id: pid, view: 'true' }, function(data) { $('#view-' + pid).html('<p>' + data.n...