Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Streaming AJAX responses
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ry  
View profile  
 More options Jul 8 2007, 4:37 pm
From: Ry <coldredle...@gmail.com>
Date: Sun, 08 Jul 2007 20:37:06 -0000
Local: Sun, Jul 8 2007 4:37 pm
Subject: Streaming AJAX responses
hi!

I'm working on a new method of doing Ajax calls utilizing streaming
responses. I've created a little javascript class (which depends on
prototype.js) that can interpret a stream of JSON objects separated by
semicolons. This class is based on prototype.

As an application of this, i created a Mongrel plug-in that streams
the upload status when given a qualified upload_id. It sends content
looking like this:
{"received":5939792,"status":200,"state":"uploading","size":36872784};
{"received":6398544,"status":200,"state":"uploading","size":36872784};
[...]
{"received":36479568,"status":200,"state":"uploading","size":
36872784};
{"received":36856400,"status":200,"state":"uploading","size":
36872784};
{"received":36872784,"status":200,"state":"done","size":36872784};
(The format of these JSON objects is the same that is being used in
the upload progress plug-in for Lighttpd 1.5 as described here
http://trac.lighttpd.net/trac/wiki/Docs:ModUploadProgress
)

Included with this package is the javascript class Ajax.Pull, and an
example Rails application.

http://s3.amazonaws.com/four.livejournal/20070708/mongrel_streaming_u...
http://s3.amazonaws.com/four.livejournal/20070708/mongrel_streaming_u...

This should work with Safari 3 and Firefox. I haven't tested IE. When
I get around to it will add a routine to Ajax.Pull which falls back on
polling a URL for the JSON updates if the browser does not support
Ajax streaming. This plug-in already supports this sort of polling
with the ?single URL parameter.

ry


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google