What I basically need is a small console application that listens on port 80 and is capable of putting json objects around.
Receiving value types, objects and List<T> (or array) from a JSON client and converting them to .net classes
Sending value types, objects and List<T> to the client
Outputting some info to the console
Performance...
I take a fat JSON array from the server via an AJAX call, then process it and render HTML with Javascript. What I want is to make it as fast as humanly possible.
Chrome leads over FF in my tests but it can still take 5-8 seconds for the browser to render ~300 records.
I considered lazy-loading such as that implemented in Google Reader ...
I am using the official Jquery Autocomplete plugin. I have an ODBC database with a list of advertisers. I currently have an input box where the user types in part of the name and I am successfully returning a list of partial matches. The problem I'm having is I do not understand how to return both the name and the ID of the advertiser...
I'm attempting to parse a JSON feed using the LastFM API but there are certain elements returned in the JSON array that are prefixed with a # that I don't know how to reference.
The feed URL is here and it can be seen visualised here.
My jQuery code so far looks like this:
$.getJSON('http://ws.audioscrobbler.com/2.0/?method=geo.geteve...
I need to bring an array of ruby objects in JSON. I will need to find the item in the JSON object by id, so I think it is best that the id is the key of each object. This structure makes the most sense to me:
{
"1": {"attr1": "val1", "attr2": "val2"},
"2": {"attr1": "val1", "attr2": "val2"},
"3": {"attr1": "val1", "a...
Is there a way to deserialize JSON content into a C# 4 dynamic type? It would be nice to skip creating a bunch of classes in order to use the DataContractJsonSerializer.
...
Hi i am using json.net for converting a json string, i am just pasting a small string here:
"incentive_type":{"cost":0,"id":4}
"incentive_type":{"cost":{"points":400,"denom":null,"acc":{"foil":{},"rates":{}}},"id":4}
now the incentive_type i have declared as :
public class incentive_type
{
public cost cost { get; set; }
publ...
HAML:
= link_to 'redeem', redeem_admin_organization_path(organization), :class => 'button_short live redeem'
Controller:
def redeem
@organization = Organization.find(params[:id])
@organization.update_attribute('accumulated_credits', '0')
end
redeem.js.haml:
== $("#organization_#{@organization.id} .redeem").html("#{escape_javas...
I've encountered this problem all of a sudden doing a simple ajax submit of a form. The JSON comes back formatted correctly but the browser prompts to download it. Fiddler shows the content-type as correct:
application/json; charset: utf-8
Here's my javascript:
$("#submitbutton").click(function(e) {
$.post('FormTest', function(o) {...
I need to be able to generate an effectively unlimited number of datasets, so what I want to do is something like this;
<input type="hidden" name="items[]" value="{id:1,name:'some-name'}" />
I tried JSON.stringify to convert my array in javascript and store it in the current hidden input element, but it wraps all the keys and values i...
I am trying to the timeline chart:
http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html#Data_Format
Data is coming in the form of a JSON feed.
Google wants the data as something like this:
{
version:'0.6',
reqId:'0',
status:'ok',
sig:'4641982796834063168',
table:{
cols:[
...
JSON responses can be exploited by overriding Array constructors or if hostile values are not JavaScript string-escaped.
Let's assume both of those vectors are addressed in the normal way. Google famously traps JSON response direct sourcing by prefixing all JSON with something like:
throw 1; < don't be evil' >
And then the rest of th...
Google returns json like this:
throw 1; <dont be evil> { foo: bar}
and Facebooks ajax has json like this:
for(;;); {"error":0,"errorSummary": ""}
Why do they put code that would stop
execution and makes invalid json?
How do they parse it if it's invalid
and would crash if you tried to eval
it?
Do they just remove it from the
strin...
Say i have this short code:
item = Item.find(params[:id])
render :json => item.to_json
but i needed to insert/push extra information to the returned json object, how do i do that?
Lets say i need to insert this extra info:
message : "it works"
Thanks.
...
I don't know whether this question makes sense or not.
I have huge amount of JSON data with me. I am getting that data from Server to the Client side.
Is it good idea to serialize the JSON object in server side ?
...
I currently have a JQuery Ajax method as below;
$.ajax({
type:"POST",
url: "default.aspx/UpdateData",
data: jsonString,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg){
alert('saved');
}
});
In the ASP.NET UpdateData method I'm using;
System.IO.StreamReader sr = new System.IO.StreamR...
I have developed one view in Silverlight and currently using WCF services to take data (around 10 MB) from Server to Silverlight view. Even though there is no processing at server side and server is taking less than 1 sec from request recieve to response return but I am getting response in Silverlight after 50 sec. I have deployed WCF se...
Hi,
consider the following class and struct
public class Entity {
public IdType Id {get;set;}
public string Data {get;set;}
}
[TypeConverter(IdTypeConverter))]
public struct IdType {
... any data ...
}
The IdTypeConverter can convert the IdType struct from and to string.
Now, what I want is this class to be serializable...
I am using fullcalendar from arshaw.com/fullcalendar for displaying events on a corporate intranet calendar. I had the className attribute working, made a couple changes to some code and now cannot figure out why it's not working. Here is the json that is returned from my service
[
{
"allDay":true,
"className":"corp...
I know this question has been possed before, but the explanation was a little unclear to me, my question is a little more general. I'm trying to conceptualize how one would periodically update data in an iPhone app, using a remote web service. In theory a portion of the data on the phone would be synced periodically (only when updated). ...