json

Nothing is wrong with my JSON but jQuery doesn't likey like. Please help

I've built some JSON { "News": { "Article": {"title": "test"}, "Article": { "title": "test" }, /*Snipped*/ "Article": { "title": "test" }, "Article": { "title": "test" } }, "count": "20" } which validates in a JSON formatter http://jsonformatter.curiousconcept.com/. But when I ...

How to get key value pairs from DataContractJsonSerializer?

the correct format for my keyvalue pairs is { "Fields": { "key1": "value1", "key2": "value2" } } But I cannot get this out of my object using the DataContractJsonSerializer, does anyone know how. [DataContract] class Product { [DataMember] public Dictionary<string, stri...

Constructively manipulating any value/object within a JSON tree of unknown depth

Hi, I have a JSON tree that contains nodes and children - the format is: jsonObject = { id:nodeid_1, children: [ { id:nodeid_2, children:[] }, { id:nodeid_3, children:[ { id:nodeid_4, children:[] }, { id:nodeid_5, children:[] } } } I don't know the depth of this tre...

ASP.NET Generic HTTP Handler (.ashx) supporting JSONP

Can someone show an example of an HTTP Handler that returns JSON and supports cross domain calls. I am using jQuery's getJSON() that sends a request to an .ashx file on my web server. I understand that I need to add ?callback=? to my url in the getJSON() url, but I'm not sure what needs to be done on the server in my ashx file? ...

WCF IErrorHandler Extension not returning specified Fault

Hopefully there are some WCF wizards out there that can spot my mistake here. I am trying to set up a global error handler via an IErrorHandler based behaviorExtension on a RESTful JSON WCF Service. The method is decorated as such: [OperationContract] [WebGet(UriTemplate = "screens/info", ResponseFormat = WebMessageFormat.Json)] The...

inconsistant output from JSON.stringify

Sorry if this is repost but I couldn't find my question after I posted it. I have a rails app that is rendering a json string and storing the same sting in the db. The output from the initial page that receives the output and the page that displays the data from the db have different output. The data and the function to format the data a...

How to obtain and push JSON data into Arrays? [AS3]

Hi Stackers, so I have a JSON link that contains a couple of nodes (not sure what you call them in JSON) that I need to put into arrays in ActionScript, but I'm still having trouble trying to trace out all the specific node content. I found a similar question here, but the fix just showed how to trace out the entire JSON file (which sho...

Question updated - IE8 XMLHTTP json code not working - innerHTML

UPDATED: after some looking around, it appears that the issue is with IE8 and replacing innerHTML in tables, rather than the json code (see here). An alert proves that the json code is returning the expected text, but I can't for the life of me get it to shove into the spot I want it. Apparently there's a problem with innerHTML and table...

Android newline in my EditText

Hi, i got some data like this "line 1 \n line 2" from my distant server by using json with utf8 encoding, and when i try to put the data in my EditText the newline \n doesn't work in spite of unscaping the data by using URLDecoder.decode() because i use databases. Any suggestions all the best . ...

How do I reference a nested array within my JSON data?

Hello, I need assistance in accessing a nested array located my JSON Data Set. Here is the first entry of my top-level JSON array: { "pingFeed": [{ "header": "Get Drinks?", "picture": "images/joe.jpg", "location": "Tartine's, SF", "time": "Tomorrow Night", "name": "Joe Shmoe", "pid": ...

IE 7 jQuery .append functionality not working

I have the following snippet of code: $("#QnAList").append("<div id=qdiv" + i + " class=divBase> <span id='" + i + "'>" + msg.d[i].QuestionText + "</span> <span id='display'" + i + "'>" + answerDisplay + "<span class='triage'> </span></div>"); msg.d[i].QuestionText is the problem that I'm having. In FF it is displaying the text perf...

How to start JSON?

Hi,everyone, I want to ask a question about the JSON. I am the green of the Ajax and I want to learn some JSON. Can anyone provide some links or reference to me? Thank you very much. ...

Best data access methods for PHP/Codeigniter/jQuery/MySQL

I'm originally a .NET dev by heart so I've always been use to having ADO.net and LINQ for strongly typed, easy data access into gridviews and other .net controls. In trying to learn PHP and MySQL with CodeIgniter and a dash of jQuery, but I'm having a hard time visualizing my data access methods. I want to use a PHP or jquery grid for ...

How to inspect mystery deserialized object in Python

I'm trying to load JSON back into an object. The "loads" method seems to work without error, but the object doesn't seem to have the properties I expect. How can I go about examining/inspecting the object that I have (this is web-based code). results = {"Subscriber": {"firstname": "Neal", "lastname": "Walters"}} subscriber = jso...

JSON Parsing in Android

Hello All! I have searched alot on JSON Parsing in Androi, but couldn't quite convinced. Actually got a brief idea but not so clear yet regarding JSON Parsing. How to implement the JSON Parsing in the Application? Looking for help!!!!! Thanks, david ...

Json problem in fetching data

<script> function jsonfunc(){ var data ="publick="+document.getElementById("publickeyval").value+"&privatek="+document.getElementById("privatekeyval").value; var url="http://www.remoteapiserver.com/example_api/example_adcpatchaapi.php?"+data; alert(url); var my_JSON_object = {}; var http_request = new XMLHttpRequest(); htt...

passing values into as_json via options hash?

I'm trying to pass an object (the current user) to be used when rendering the json for a collection. respond_to do |format| format.html # index.html.erb format.xml { render :xml => @items } format.json { render :json => @items.to_a.as_json(:user => current_user) } end However, this seems to have no effect as options[:user] is ...

PHP foreach error "Invalid argument supplied for foreach"

Hi guys, I was previously using this code and it worked perfectly fine, but when I put it on another server just now it started freaking out, I am passing a JSON object to a PHP file and traversing through it, the foreach I used seemd to work fine, but now I get "Invalid argument supplied for foreach", PHP: <?php $json = $_POST['sy...

PHP json_decode not supported, any alternatives?

Hi guys, as the title specifies, my hosting provider does not have support for json_decode, so I need to find a way to adapt my code to achieve the same effect, but without using JSON, here is my code, jQuery: var allLocations = []; $(".locations").each( function(i, location) { // for each location block loca...

Javascript Eval() Json problem.

I have a JSON string below : { "name":"Ruby on Rails Baseball Jersey", "price":"19.99", "id":"1025786064", "image":"http://127.0.0.1:3001/assets/products/4/product/ror_baseball.jpeg" }, { "name":"Ruby on Rails Baseball Jersey", "price":"19.99", "id":"1025786064", "image":"http://127.0.0.1:3001/assets/product...