json

Classic asp server-side JSON library

I have inherited some classic asp code and I need a JSON library that can be instantiated and run server-side for use with JavaScript-coded server-side asp. How can I do this? ...

Json Deserialization to Dictionary .NET

Given json like this: [["Rating (out of 5)","3"],["Date taken","Mon, 03 Mar 2003 03:04:03 GMT"]] What is the best way to deserialize it into something like Dictionary<string, string> or should I be using a different data structure? I'd probably prefer to use the .net Serializer but will consider other options if this wont work. ...

Creating a JSON Tree from a string hierarchy

Given these 4 variables, var el1 = {name:'ronaldo', team: 'europe/spain/realmadrid'} var el2 = {name:'messi', team: 'europe/spain/barcelona'} var el3 = {name:'gerald', team: 'europe/england/liverpool'} var el4 = {name:'unknown english', team: 'europe/england'} I need to produce this JSON tree hierarchy, { "text":"europe", "le...

Convert Javascript Array to JSON

Hay I have an Array (var cars = []) which hold a few integers. I've added a few values to the array, but i now need to send this array to a page via jQuery's .get method. But i want to send it as a JSON object. How do i convert an array to a JSON object? ...

how i can use jquery ajax with php json

How I can make this: $.ajax({ type: "POST", url: "", data: dataString, cache: false, success: function(html){} }); but datatype json and using it by php please tell me an example because i tired to search in the internet ...

Silverlight passing JSON object incorrectly?

I have a Silverlight class marked with the ScriptableType & ScriptableMember and I expect to be able to pass the object from Silverlight to javascript. When I call JSON.stringify (in javascript) I expect to receive a JSON representation of the object but all I get is {} The class is defined as: [ScriptableType()] public class MyEvent {...

jQuery + Facebook style status update textbox - Autocomplete links to profiles

I have a social networking website with a status update textbox, much like facebook. However I would also like the user to be able to type the @ symbol while typing a new status which brings up an autocomplete option of friends profiles (again the same as facebook does). When the user selects one it should be included in the status as ...

SQL queries through VB.NET and JSON

I'm completely new to both VB.NET and JSON, and I'm trying to figure out how to do SQL queries towards an SQL 2005 Express server and format the return value to JSON. I got the queries working using this (perhaps very newbie-like) code; Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Web.UI Imports System...

The regex test in jQuery's parseJSON returns false - why?

I don't understand why the test in jQuery's parseJSON function: /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) returns false for the string: {"TermTitle":"some...

JSON in location.hash for AJAX(J) bookmarking?

I'm building an AJAJ (AJAX with JSON) webapp with jQuery and I'd like my users to be able to bookmark a page that saves all of their setting selections for a certain part of the app. I've got quite a bit of data that needs to be saved, so I thought JSON might be the best way to save this, putting it into the location.hash. That being sa...

Generic WCF JSON Deserialization

I am a bit new to WCF and will try to clearly describe what I am trying to do. I have a WCF webservice that uses JSON requests. I am doing fine sending/receiving JSON for the most part. For example, the following code works well and as expected. JSON sent: { "guy": {"FirstName":"Dave"} } WCF: [DataContract] public class S...

Fix JS object replacing/encoding of strings?

Hi everyone, I have an object with a value that has spaces in it, and it gets replaced with an encoded string, like: alldata["test"] will return "Long+name" or something like alldata["test"] will return "%BLong+name%B" when it's set by using alldata["test"] = "Long name" (or "[Long name]") via a series of code. Am I missing somethi...

Javascript JSON.stringify object containing arrays serialization problem

I javascript I have an object that looks similar to: var myObj = { prop1: 1, prop2: 2, prop3: ["a","b","c","d","e"], prop4: 4, prop5: ["f","g","h","i"] } It's an object containing a number of properties. Each property may or may not be an array. var serializedMyObj = JSON.stringify(myObj); serializedMyObj is (fou...

Using a web service for cross site scripting

I want to pull down a feed (like twitter) and place in on a page using javascript (jquery). Ultimately, the "service" just needs to hand off JSON. I created a web service that allows me to do that, sort of. I don't know if using a stream reader is all that efficient and I was a little bothered by having to use what amounts to 2 evals on ...

How to replace all &#160; siblings from JSON string in JavaScript?

How to replace all "&#160;" siblings from JSON string? {"Cat":"laps&#160;milk","Dog":"Woofs&#160;at&#160;Postman","Bird":"Jumps&#160;over&#160;the&#160;river","I":"Want&#160;to&#160;learn&#160;Regexp"} And btw, advice me please some good article or book from where I could finally learn Regexp :( ...

skipping unknown items while Serializing using json

I'm trying to serialize obj using json (Python). I wish to skip json's unknown type I know I can add my own encoder, but what I'm interested in is to just skip the unknown type. I don't want to use None instead. I have tried icon=QIcon() arr=["blablal",icon] str1=simplejson.dumps(arr,skipkeys=True) I used the skipkeys op...

How can I serialize and communicate ActiveRecord instances across identical Rails apps?

The main idea is that I have several worker instances of a Rails app, and then a main aggregate I want to do something like this with the following pseudo pseudo-code posts = Post.all.to_json( :include => { :comments => { :include => :blah } }) # send data to another, identical, exactly the same Rails app # ... # Fast forward to the s...

retrieve and display multiple mysql records with jquery

This is what I have got. It displays just one single record. Can anyone please tell me how can I retrieve multiple records from the table. $.getJSON('getinfo.php', { id:id }, parseInfo); function parseInfo(data) { $('div#info').html(data.name +': '+ data.title); } The getinfo.php part is as follows: $id = (isset($_GET['id'])...

How to serialize DOM node to JSON?

I want to serialize DOM node or even whole window to JSON. For example: >> serialize(document) -> { "URL": "http://stackoverflow.com/posts/2303713", "body": { "aLink": "", "attributes": [ "getNamedItem": "function getNamedItem() { [native code] }", ... ], ... "ownerDocument": "#" // recursive link he...

.Net Regex to parse specific JSON format

I'm writing a little web service which generates SO/SF/SU/MSO user flair in the form of an image with various "themes". I find this preferable to using the HTML/JS solutions offered by SO as it's more flexible and also works better in forum signatures. I'm retrieving the data using the apparently unofficial API (More info here). I can h...