json

Examples of practical usage of JSON to and from an ASMX web service via jQuery

Can anyone recommend an article on sending and receiving JSON to an asp.net web service (any flavor) that uses more practical examples than "hello world". Ideally, something that covers topics like: Receive a single complex object from a web service (to display in a form) Receive a collection of complex objects from a web service (to...

ASP.NET MVC: Controlling serialization with JsonResult

Is there a way to control the JSON output of JsonResult with attributes, similar to how you can use XmlElementAttribute and its bretheren to control the output of XML serialization? For example, given the following class: public class Foo { [SomeJsonSerializationAttribute("bar")] public String Bar { get; set; } [SomeJsonSe...

Is this JSON correct and if so how to iterate through each object in JavaScript - Asp .Net 3.5

I have created a C# web service that retrieves a data table with 2 columns, that data table is serialized using JavaScriptSerializer. Using FireBug, I see the following JSON which appears correct to me: "{"d":"[{\"Text\":\"4 blah blah2\",\"Value\":\"16\"},{\"Text\":\"asdf\",\"Value\":\"15\"},{\"Text\":\"qwerty\",\"Value\":\"13\"}]"}" ...

update json data into db

Alright... this seems complicated for me.. I don't know if it is. filename: add_types.js I have some data, which i create into mysql db (is for a back-end system). through jquery/ json. It work fine. var last_id = data.last_id; var fck_editor = data.fck_editor; var new_data = '<div id="input_highlight'+last_id+'"><strong...

What is JSON-P & how do you pronounce it?

Related question: Explanation and usage of JSONP. I know what JSON is but what is JSON-P? How do you pronounce JSON-P? ...

Assign an existing javascript array to a property in object notation...

Hi, I'm localizing a menu and I want to assign a declared array to an object property in that way: var menuListLocal=["Home","Play","Options","Exit"]; var menu_Controller={ _menuList: menuListLocal, // .... // } Sorry if it is too obvious. Thanks. ...

JSON / JSONP / DabbleDB

I'm trying experiment with DabbleDB to see if it's something that I could use to store data in. They have a JavaScript API that's based on JSON (http://dabbledb.com/help/guides/jsapi/). I've never used JSON before and have been trying to understand how to use it. The above link has their APIs file (which I downloaded and called "json-a...

YUI Menu: Build tiered menu based on attributes from json object

I have a json object that has properties into a type and product. I am looking for a way to loop through the elements and organize them into a tiered menu using YUI menu so the first level would group them by type and then the second menu would group them by product. The json looks something like: [{ "productId":1, "typeId": 1, "produc...

Should I be using JSON or XML or something to fetch a pages contents every X amount of time?

index.php has this jquery code which loads notifications.inc.php into a div on the page every X amount of seconds <script type='text/javascript'> $(document).ready(function(){ var updatenotification = function(){ $('#notificationcontainer') .load('notifications.inc.php') .fadeIn("slow"...

How to access remote JSON data as a local array

I'm able to use Jquery's $.get function to access JSON data from another URL, but how can I use that data (as an array) elsewhere in my code? Consider the following code: <script type="text/javascript"> $(function () { $.get("/some/other/url/that/returns/json", function(data){ var d = eval(data); }); ...

JSON return format in ASP.NET MVC

Hi! Actually my question is simple. I think. But unfortunately, Google can't help me this time. I want to return a JSON in my view in this format: [[0,"Mark Kordon",null,"My HTML - Mark Kordon"],[1,"John Doe",null,"John Doe Markup"]] How is this possible? Thanks! ...

jQuery/jqGrid: populate select boxes with multiple values

Hello! I'm setting up a jqGrid which needs to visualize multiple values in one cell. The input comes from a form where the user can select multiple choices. I am able to display the select box, but not populate it. I have tried to insert an array in the JSON object, but to no success. This is the model: index:'ship', editoptions:{mult...

How to import JSON framework?

I've downloaded the JSON framework DMG from http://code.google.com/p/json-framework/downloads/list. I followed Option 3 here: http://code.google.com/p/json-framework/wiki/InstallationInstructions. For the copy files build phase, I set path to ~/Library/Frameworks/JSON.framework. Buid failed. I then tried setting it to my project root....

How can I insert this block of html into a page from a json response with jquery?

<script type="text/javascript"> var dataString2 = 'run=captchagood&comment=' + comment; $.ajax({ type: "POST", url: "process.php", data: dataString2, dataType: "json", error: 'error', success: function (data) { if (data.response === 'captchasuccess') { $('div#loader').find('img.load-gif').remo...

jQuery clone question

I have a problem. I use this code: $( '#wall_msg').clone( true ).insertAfter( '#wall_msg' ); What can I do to set the ID for the clone and I need to fade the new item in with $.getJSON in jQuery. I hope for help. :) ...

Jquery ajax live validation / timeout question

Hello, I'm still kindof new to jQuery, so there probably is an easy solution, but I can't find anything. I've made this registration form, that checks if the username or email is taken as the user is typing in the username. Basically it just makes a json request that returns true or false depending on if the username / email is already t...

What to ask for in web services documentation?

A 3rd party is developing a web services library, which my team will be consuming. What should I ask for in terms of web service documentation? Here's my list so far: WSDL URL Sample Request (XML) Sample Response (XML) Response Schema Definition Anything else? What documentation should be provided for web services that return JSON...

JSON Parsing Error

Hi there, I got problem. I have this JSON automatically generated by Open Flash Chart php library. The problem is, OFC report JSON Parse Error [Syntax Error] while test result using http://www.jsonlint.com/ report that my JSON is fine. But, w3c parser report error too:( Any help? Here's the JSON: { "title": "Followers Trend", ...

flot graph on a timer

I want my flot graph to update it's data on set intervals. I have been unable to find any built in functionality that does this so I intend to do something along the lines of redrawing the graph each time an interval expires. The data parameter being passed to flot is the only value that will change. The data variable is populated using ...

JSON in Groovy / Grails

I'm trying to access a site via their JSON export. The URL is: http://neotest.dabbledb.com/publish/neotest/f820728c-4451-41f6-b346-8cba54e52c6f/projects.jsonp I'm using HTTPBuilder to try and accomplish this in Groovy, but am having trouble. I used the example code from http://groovy.codehaus.org/HTTP+Builder to come up with this: ...