json

Rails object relationships and rendering to JSON question

Disclaimer, I know very little about Rails. I'll try to be succinct. ModelA belongs_to ModelB ModelB has_many ModelA The JSON Show action of the ModelA controller should show all ObjectA's that are belonging to the ObjectB of which the ObjectA in question is a member of. So if I have an ObjectB that contains ObjectA's of ID 1, 2, and ...

ASIHTTP Request failed in log, but requestFailed not getting called

I have -(void)requestFailed:(ASIHTTPRequest *)request { NSError *error = [request error]; NSLog(@"Request Failed Error: %@", error); } When I make my request I do //add data to the array NSString *json = [array JSONRepresentation]; [request appendPostData:[json dataUsingEncoding:NSUTF8StringEncoding]]; [request star...

Recommended APIs for checking domain availability?

Does anyone have experience with the APIs of registrars like GoDaddy? The goal is to use Javascript to check the availability of domain names. Someone asked a related question on StackOverflow, but the answers focused on WHOIS. I'm hoping someone provides a more robust, JSON-based API for checking domain availability. It seems natura...

ExtJS: load JSON from an external file into TreePanel

You can grab data from here. Instead of saving JSON as a separate variable within the script file, is it possible to create a file pointer, and populate a Tree with one config option? Saving JSON in a variable does the job, but it's quite cumbersome! ...

Escaping quotes in json string

System.Web.Script.Serialization.JavaScriptSerializer s = new System.Web.Script.Serialization.JavaScriptSerializer(); result = s.Deserialize<Hashtable>(data); Error is thrown if data is "{a:\"\"test\" 123\",b:\"hello\" }" No error is thrown if data is "{a:\"test 123\",b:\"hello\" }" How do I adjust the data string so that no error is ...

Convert a Map<Object, Object> to a Json String

Let's say I have a class like this: public class Person { private String firstName; private String lastName; ... } Then I create a map like this: Map<Person, String> map = new HashMap<Person, String>(); map.put(new Person("Bob", "Builder"), "string1"); map.put(new Person("Bob", "NotBuilding"), "string2"); What should a ...

why does file_get_contents get nothing from the web service?

hi all, we're using file_get_contents to communicate with a web service, which creates users and if succeeds it returns a JSON object with the details of the new created user. the code below shows how we do it, the user is successfully created, meaning we can see it from the back-end, however, we just can't get the JSON response, it re...

using .ajax in jQuery to get JSON data success but no data returned

I'm trying to get some json data via .ajax() method in jQuery, here is my code: $.ajax({ url: "http://localhost:8080/abc/message.js", type: 'GET', data: {}, beforeSend: function(x) { if(x && x.overrideMimeType) { x.overrideMimeType("application/j-son;charset=UTF-8"); } }, datatype: 'json', ...

Need to know how to get this piece of JSON into HTML using jQuery/JS

Hi! I need to know how one would put the following JSON into elements with a class name of article using jQuery AND just some basic JavaScript: {"elements": [ { "head": "story 1", "writer": "journalist 1" }, { "head": "story 2", "writer": "journalist 2" } ]} Trying to achieve the below H...

performance problem with WebKit which gets 50.000 POIs via webservice

Hi, I've got a lot of POIs (compare MKAnnotation Protocol) in a backend on a webserver. I don't want to have a complete dump of all those in an iPhone database since normally you only need the POIs around your area. So my idea was a webservice which gets the actual shown region as paramters and gives back all relevant POIs. So far so goo...

JQuery.Ajax call to Asp.Net MVC JsonResult gives 12031 error, Json webservice works fine

I have the following 2 jQuery Ajax calls. The first is a call to a Asp.Net Json Webservice and always works. The second is a call to a ASP.Net MVC action that return an json result. This call always fails with Status=12031 the first time the page is loaded. The responseText is empty. After a refresh de second call usually works fine. jQ...

Help reading JSON from HttpContext.InputStream

I have created a HttpModule to capture requests for auditing purposes. For Ajax requests to a web method I would like to also log the JSON data associated with the request. E.g Request POST /MyPage.aspx/AddRecord HTTP/1.1 x-requested-with: XMLHttpRequest Accept-Language: en-gb Referer: http://fiddlerlocal:5000/AddRecord.aspx ...

Alert Json object

I have the following json object i need to alert it through javascript. {data:[{"empmenuid":"1","empid":null,"deptid":"66","aliasid":"66","firstname":"66","lastname":"66","sin":"66","status":"66","empclass":"66","hiredate":"66","seneoritydate":"66","separationdate":"66","recalldate":"66","martialstatus":"66","gender":"66","ethinicorigin...

Sending a json object over Flash Builder 4 webservices

Can I use the webservice wizards in Flash Builder 4 to send a json encoded object...not as a string but as type application/json; charset=UTF-8 ...

ExtJS, display script tag in text area from json obj

I want to display a script tag in plain text that is returned in a json obj. A user enters some text in a text area, the text contains <Script>. I want the user to be able to do this. The form is submitted using json back to the server for some processing, the json returned contains the <Script> tag for the text area. I want to display ...

How do I know if a server has JSONP turned on?

How do I know if a server has JSONP turned on? It is not my server, but I try to access some information from the rendered html. Thanks in advance. ...

how to return json format from ODATA?

Hi guys, I know ODATA can return json but not sure if I have to use an attribute or interace to do so. I want it to do just like http://odata.netflix.com/Catalog/Titles?$format=JSON but my odata service doesn't return JSON when i call it like www.foo.com/service?$format=json, it just returns XML. What do I need to do to return json wi...

use odata or MVC to return json?

Hi I am trying to use ajax to do CRUD. Should I use ODATA or MVC? i am also planning to use json in mobile platform as well. Thanks guys ...

java: xpath on json

I need a fast way to extract data from json responses a I get from a webservice. By fast, I mean fast for the programmer, not necessarily for the computer. I was thinking of something like Xpath for Json, if such a thing exists. Any ideas? I am open to any Java Json library. In fact, the easiness to extract data from Json with a power...

Where can i find a good video or tutorial on JSON with PHP ?

I have search the net many times and a lot of the JSON tutorials are too hard to understand. I am looking for JSON with jQuery and PHP. if anyone knows any videos or website i can look at that would be great Thanks ...