json

.net 2.0 ajax jquery pagemethod 404 object not found

in my master page, i have <head> <script type="text/javascript"> $(document).ready(function() { $("#result").click(function() { $.ajax({type: "POST",url: "ws.aspx/HelloWorld",data: "{}",contentType: "application/json; charset=utf-8",dataType: "json",success: function(msg) { $("#result").text(msg.d); } }); }); </script> </head> <body> <f...

Using YAJL to render json in Rails 2.3.4

I want to use YAJL to render JSON. If I require 'yajl' in the controller and perform a render :json => some_hash, will this use YAJL to encode the hash into json? Should I convert the hash to JSON using YAJL's encode method before calling render? If not, how can I go about doing this? ...

How do I update a deserialized entity using NHibernate?

Let's say I have an entity like so: public class Product { public virtual int Id { get; set; } public virtual int Name { get; set; } } A client wants to update the name of a particular product, so he sends this JSON back to an ASP.NET server: { "Id": 1, "Name": "Updated Product Name" } I then run this code to try an...

How can I interpret a JSON object received as a string correctly?

Hi, I've got a broken web service that I can't access and alter. It sends down some mainly nice JSON, but one of the attributes is a nested JSON object that is being sent down as a string. http://www.ireland.com/api/getitemweb/185213 CustomJsonData in the response from the above url is the example. My question is how could I interpret...

Highcharts & Mysql

Hi, I need help with this code,I manage to extract data from a mysql database and convert them to a format required by Highcharts. <?php $query =mysql_query("select date_format(connect_time,'%Y-%m-%d %H %i') AS date, Customers.name as customer, Sum(duration) as secondes from CD...

Play Framework renderJSON Issue

I'm new to Play Framework, and having trouble rendering a JSON object. public static void LoginFail() { Object[][] statusArray = { {"Status", "401"}, {"Message", "Unauthorized"}, {"Detail", "No API Key Supplied"} }; renderJSON(statusArray); } This only displays "[[{},{}],[{},{}],[{},{}]]"...what am I doing...

Why does JSON encoder adds escaping character when encoding URLs?

I am using json_encode in PHP to encode an URL $json_string = array ('myUrl'=> 'http://example.com'); echo json_encode ($json_string); The above code generates the following JSON string: {"myUrl":"http:\/\/example.com"} Rather than {"myUrl":"http://example.com"} I am just newbie, which output is correct? Is JSON parser able t...

issues with quotes in json string :php

Hi All, I have tried lots of things and could not get through yet. I have a json string with some single quotes, double quotes and some other characters which are causing an error when I am trying to iterate the json by converting in into an array. The quotes are escapes using addslashes and are going correctly in the database. But whe...

Json Array inserting to a Android ListView

Hi I am trying to populate a ListView in the android app. I have the data in a JsonArray, But it doesn't work to directly use the JsonArray. Any suggestions How to populate the ListView? JSONObject json = null; try { json = new JSONObject(client.getResponse()); JSONArray nameArray = json.names(); JSONArray v...

Java : The constructor JSONTokener(InputStreamReader) is undefined

Hi, I have a quite strange issue with Java, I'm getting an error on some machines only, I would like to know if there is any way I can avoid that: This is the line of code concerned: JSONTokener jsonTokener = new JSONTokener( new InputStreamReader(is, "UTF-8")); This is the error I get on some machines The file *.j...

JAVA - JSON library that handles circular refrences

Please let me know the JSON Library that can handle circular refrences. If there is any please explain how to use it ...

Problem creating markers from JSON

I am trying to create markers from a database. I do this by outputting the DB results to json and loading the json in the google maps code. The JSON is valid and is being loaded. My full Google maps code is: google.load("maps", "2"); // make a json request to get the map data from the Map action $(function() { if (google.maps.BrowserI...

Javascript Arrays - Consolidating Multiple Arrays Help

Hi Guys, I wonder if anybody could provide me with any assistance to the following problem I am having with my JS project? I basically have information about a product being pulled from out from 3 different JSP lists: A Product's Details A Products's Ratings A Products's Retailers What I am trying to a do is loop through the JSP th...

Serving Json from WCF Service with no extension in IIS

I have a WCF service set up to serve data through multiple endpoints (SOAP, JSON and XML) the SOAP and XML is working perfect, but when I try to view the json I get a prompt to download a file with the json results instead of displaying the results in the browser. This probably won't matter as the client will most likely be consuming th...

Generate JSON in Rails for JavaScript object parameter

I'm trying to generate a chart in my Rails 3 project using the canvasXpress HTML5 / JavaScript library. Their charting API uses JSON as one of the parameters in their constructor. For example: new CanvasXpress('canvas', /* JSON here */); In Rails I'll have a view which renders the chart as part of it's overall output. So, the JavaSc...

Asp.Net MVC - JQuery remote validation

I got the following JQuery validation script : <script type="text/javascript"> $(document).ready(function() { $("#myForm").validate({ rules: { "Content": { required: true, rangelength: [20, 1000], remote: { url: "/RemoteValidation/IsValidContent"...

Get correct data from JsonObject

Get correct data from JsonObject.. This is how the jsonstring looks like: [ { "EditLink": "http:\/\/localhost:8080\/Service.svc\/A?format=json", "Item": { "Value": "A" } }, { "EditLink": "http:\/\/localhost:8080\/Service.svc\/B?format=json", "Item": { "Value": "B" } }, { "EditLink": "http:\/\/localhost:808...

JQuery Map and JSON - Getting Sub Array Elements

I'm using JQuery to get city data from geonames. My problem is when I want to extract the value for sub-array items when using the JQuery map function. In this example, if I want to get the Wikipedia link, how could I do this? I tried: wikipedia: item.alternateNames.lang['link'] but didn't expect it would really work. Does anyone kn...

Disable Type Hinting in WCF JSON Services

I have what should be a relatively simple question that I can't seem to find an answer for. When WCF performs its serialization of objects, it automatically applies Type Hinting. For Json services, this results in an extra field on each complex object called __type. An object defined as: [DataContract] public class SomeObject { [Da...

jQuery UI autocomplete + CakePHP

I'm setting up jQuery UI autocomplete on a CakePHP site, and feel like I'm missing something really obvious, but it's almost working... So the simple jQuery code is: $(function() { $("#SearchQuery").autocomplete({ source: "<?= $session->base ?>/search/complete", minLength: 2 }); }); This connects to my search ...