json

Looping through JSON array - Formatting properly

I have a result set that when I use json_encode() in php, returns the following [ {"id":"1","name:","value"}, {"id":"2","name:","value"}, {"id":"3","name:","value"}, {"id":"4","name:","value"} ] I'm then using jQuery to try and loop through this: $.each(data, function(index, itemData){ alert(itemData.id); } The problem is it's on...

asked to download file when using ajax with ie. (AJAX/PHP)

For some reason IE is asking us to download a file instead of running it as ajax. This works in all browsers except IE. I tried messing with the headers that it returns with no luck. The function grabs form data then post's it the response is a can be an array of any number of items to be updated on the page. Its not suppose to be fi...

Should I use the template to render JSON or use Controller returning JSON in RoR?

That's my great doubt. We have a project in RoR and we are making it more dynamic, using Ajax calls. They want that I put literal JSON in html templates and parse it with eval() in javascript, avoiding to putting exception into Controller to return response as JSON directly. Example: WhateverControoler#index -> will render views/whatev...

Ajax and JSON response bug in Internet Explorer (works in all other browsers)

For some reason IE is asking us to download a file instead of running it as ajax. This works in all browsers except IE. I tried messing with the headers that it returns with no luck. The function grabs form data then post's it the response is a can be an array of any number of items to be updated on the page. Its not suppose to be fi...

TypeError: 'type' object is unsubscriptable using python on google app engine .

i use gaefy.db.properties 's JsonProperty # -*- coding: utf-8 -*- """ gaefy.db.properties ~~~~~~~~~~~~~~~~~~~ Extra properties for App Engine Models. :copyright: 2009 by tipfy.org. :license: BSD, see LICENSE.txt for more details. """ import csv, pickle, simplejson from cStringIO import StringIO from google.appengi...

Trying to create a 6 level combobox that uses JSON on the backend

I have been looking at a lot of combo boxes but have yet to see one that uses JSON on the backend or one that is more than six fields. I was trying to use http://www.appelsiini.net/2010/jquery-chained-selects as a resource but am having trouble implementing JSON at the backend. Would someone mind giving me a hand? ...

Infinite loop when Json serializing a Collection (VB ASP.NET)

I am trying to use a Web Service to return Json for a Collection of Users from a Database Table. I'm only new to .NET (< 1 week experience), and I don't want to use the UpdatePanel for AJAX. I have tried using the JavaScriptSerializer as well as Json.NET to serialize. Both cases seem to spawn an Infinite Loop. What am I doing wrong? Is ...

Jquery Flot problem when loading JSON

Sorry for the noob question. I've read through a couple questions and am unable to solve my problem. I cannot seem to load the data. I have the following json code output from a php script. {label: "load",data:[[1283294013*1000, 2.03],[1283293998*1000, 2.04],[1283293983*1000, 2.06],[1283293968*1000, 1.99],[1283293953*1000, 1.98],[1...

Routes in Global.asax doesn't register

Hei guys i have this JQuery Ajax call from my view and it looks like this: $("select#Colors").change(function() { var color = $("#Colors > option:selected").attr("value"); $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", url: "FindProducts/" + color, d...

Adding an AJAX call to this Combobox to read through JSON

I'm having problems adding a XHR request to query JSON to my script, I rarely work with either so it's giving me a lot of problems. I know that I will need to query a JS file, and that I will need to select from matches in an array, but I am completely stumped on how to do it. Something else I need to do is count matches each time I fir...

jQuery UI Autocomplete based function

I have 2 HTML files - file1.html in xyz directory and file2.html in abc directory ... both the directories are at different levels. Now, I have a external JS file in which I have used jQuery UIAautocomplete widget and I have used datasource URL for ajax call as a PHP file say datasource.php ... Here I mentioned data source URL as abso...

JSON Data cannot be matched to web service signature

I still can’t seem to get this to work.I’ve tried string arrays object arrays dictionaries. I might be formatting my JSON incorrectly however I am using the labs_JSON plugin. If I remove my data and test the webservice it calls correctly. The : My code looks as follows : HTML : <div style="display: block; float: left;"> <asp:R...

getJSON not returning anything...

Hi guys, The JSON function below is not returning anything... $.getJSON(formUrl, function(data) { alert(data) $('.response').html('<p>' + data.title + '</p>' + '<p>' + data.description + '</p>'); }); the formUrl is correct and returning data in the form of {"title":"Smashing...

JSON vs. XML parsing speed in Flash AS2

All, I'm working on a Flash AS2 project in which I have a choice of receiving a dataset in either XML or JSON. The dataset is probably about 100-1,000 rows of data; each row has roughly 50 fields; most values are numeric. If I use XML, I'll be able to define the XML myself, to make sure it's as compact as possible. So, I could use so...

DataContractJsonSerializer changing my date

A user enters a date in a form, but when I pass a date through an AJAX json call, my date is getting changed by the DataContractJsonSerializer. Here's my AJAX call: function Save() { //Convert date to milliseconds from from 1/1/1970 - necessary for passing a date through JSON var d = "09/01/2010 05:00"; myDate = new Date(d)...

What kind of security threat i could face using web services?

In regards to my this question, I got this following answer to add this to the web config file. And it also resolved the issue i was facing. But now my question is that is there any kind of security threat? if yes, how severe it could be? what kind of threat it could be? Do you suggest something else here. <configuration> <system.we...

Best JSON format for UI developers

What's the best format for the JSON object for use in common Grids? I know this is a subjective question. I've been writing a method to return a JSON object to represent some of our server side data. I've spent the last couple of days trying to fit the JSON object into a view, jqGrid in particular, I was about to demo how it might work ...

Pagination not working for the json in JqGrid

My pagination is not working when I removed the loadonce:true ...but if I use loadonce:true than my grid is not working. Any idea how can I get my pagination work again. update: this is extension to http://stackoverflow.com/questions/3610173/problem-loading-data-in-details-jqgrid-from-master-grid ...

How To Change Default Media Type for Spring MVC From XML to JSON.

Title pretty much says it all. Right now it's using XML as the default in the responses from my controller but I want it to use JSON as the default when no Accepts header or format parameter is specified. My mvc-config.xml <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> <property name="mediaTypes...

Json issue in a sub-class

I have 2 DTO files, with one of them being a sub-class of the other. The fields on the super-class are as follows: [JsonProperty] protected int financialFormatHeaderID; [JsonProperty] protected string financialFormatHeaderCode; [JsonProperty] protected string description = string.Empty; [JsonProperty] protected FinancialFormatPurpose...