json

Autocomplete in jQuery 1.4.2 jQuery UI 1.8.3

I must be thick because I cannot for the life of me get jQuery autocomplete to work. I have searched for many many examples, and it seems that most of them use an older version of jQuery. I found one fairly good example directly from the jQuery UI site: http://jqueryui.com/demos/autocomplete/#remote-jsonp So I modeled mine after that exa...

How to loop through JSON Data?

I have an ashx page that returns the following JSON data that I would like to be able to loop through and add to values to a bunch of li's in a ul. My question is how do I loop through to retrieve the values. The data that is returned from the ashx look slike this {"ImageCollection": { "Images": [ ...

C: JSON processor

Possible Duplicate: Parsing JSON using C? What's is the best C library for processing JSON? There are several listed at http://www.json.org/. ...

How are JavaScript/JSON based OData calls authenticated?

I'm new to OData (most everyone is I think). If I have an OData service, how do I secure it from unauthorized use? I'm looking at using WS-Trust/SAML, or standard authentication if that matters. ...

JSON from a .js File

Hi all, I am working on something using JSON and I can't seem to figure out how to do this. I'm receiving a JSON object that looks like this: {"List" : ["ob1":"c1","ob2":"c2"...]} I am getting this from a .js file. How do I use the object? So far I've only worked with files that have objects like this: Object = {"List" : ["ob1":"c1",...

How-to handle legacy classes with Xstream?

API publisher added new field to their response object that isn't in my model classes. Is there a way to loosen up the mapper to ignore unknown fields? I still want to use my old legacy model classes to parse, but now I get an exception... ...

What can I do with JSON?

Hi. I want to, in brief, find out about what I can do with JSON; whether it is an alternative for JavaScript or what? ...

Output JSON object from unordered list with jQuery

I am working on this jsFiddle: http://jsfiddle.net/8vWXZ/10/ I want to post the order of the list items and their associated ID on the form submit to the server as a JSON object but am not sure where to start. ...

What are "top level JSON arrays" and why are they a security risk?

In the video below, at time marker 21:40, the Microsoft PDC presenter says it's important that all JSON be wrapped so it's not a top level array: http://www.microsoftpdc.com/2009/FT12 What is the risk of an unwrapped top level array? How should I check and see if I'm vulnerable? I purchase many components from 3rd parties and have ex...

Custom JSON IErrorHandler in WCF returning StatusCode 200/504 when should return 400

Hi! I have a WCF service that among other bindings also uses WebHttpBinding for JSON inputs/results. I made a custom IErrorHandler implementation in order to be able to set the StatusCode to 400 when something goes wrong and also return a JSON understandable message. It´s the straight implementation that you can find everywhere (nice w...

json request causes the browser to display a popup, I set JsonResult in the action

My code: [HttpPost] public JsonResult DoBlah() { .. return Json(mySerializedObject); } In firebug, I can see the response content type is using application/json. But for some reason, I get a popup with the json response. What could the issue be here? ...

Add Additional Objects to JSON Encoded Array

Hi, I am currently using a JSON encoded array to display the users in my database for an auto-suggest feature. It looks something like this: $sth = mysql_query("SELECT id, name FROM users"); $json = array(); while($row = mysql_fetch_assoc($sth)) { $json['name'] = $row['name']; $json['id'] = $row['id']; $...

build json object in javascript to post to php

I have a group of radio buttons in a form, I need to pass the values of the selected radion buttons to a php script. So I need to build a json object to post. I tried with this code, but I'm not sure. Please could anyone help me. result = []; for (i=0; i<document.getElementsByTagName('input').length; i++) { if (document.getElements...

How to calculate where to add `<tr> and </tr>` when formatting JSON Data as an HTML Table?

So what I want to do I'm sure has been done thousands of times. I am just having trouble finding the solution. I am receiving some JSON data that looks like this {"ImageCollection": {"Images": [{ "ImageID":"68", "CatID":"1", "Location":"/Images/Art/Full/68.gif", "ClipLocation":"/Images/Art/Clips/68.gif", "FullHeight":"...

wcf 3.5 REST service works with XML but not JSON response format

I have a service contract with several operation contracts defined. I have added a new endpoint to expose my operations as a restful webservice. Moreover I've updated operation definitions so that they can be called in a RESTful way [OperationContract] [WebInvoke( Method = "GET", ResponseFormat = WebMessageFormat.Xml, ...

Generate ruby classes from json document

Consuming a ruby json API, I want to save me some work and generate ruby objects off the bat. Any way to do this? so you could transform this: {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value...

how to get JSON response in php from Facebook

Hi! I want to receive the JSON Response from (Facebook) https://graph.facebook.com for further processing in PHP. How can I access the JSON ...

JQuery ajax cross domain

Hi guys, I am fed up with this problem. Here is two pages, test.php and servertest.php. test.php <script src="scripts/jq.js" type="text/javascript"></script> <script> $(function(){ $.ajax({url:"testserver.php", success:function(){ alert("Success"); }, error:function(){ alert("Error"); }, dataTyp...

Display Json file inside an html file

hi, I am very new to Json but im trying to display a json file inside an html body. my json file looks something like this { items: [ { "thumb":"http://link/link.jpg", "title":"title of the link", "link":"http://link.html", "popup":"false" }, { "thumb":"http://link/link2.jp...

PHP: Problem submitting form in AJAX/JSON ?

currently I have following code: home.php <form name='myformname' id='myformid'> <input type='text' name='mytext1' value='abc'> <input type='text' name='mytext2' value='123'> <input type='submit' value='Submit'> </form> <div id='textone'></div><div id='texttwo'></div> _home.php $arr = array( 'textone' => $_POST['mytext...