Monday, November 20th, 2006
Category: JavaScript
, Library
<
p
>Chris Marshall has a background in writing low-level
asynchronous code in C++. When he started to write Ajax code he saw the need to manage concurrency and created a
Ajax Queue Class that handles all of this for you.
An example using the library is this file browser where you see the root of the library:
JAVASCRIPT:
-
-
function callout ( in_request, in_id ) {
-
var url = 'ajax_file_browser_server.php?'+in_request;
-
g_ajax_obj.CallXMLHTTPObjectGETParam ( url, receive_browse_results, in_id );
-
}
-
- JavaScript Achilles heal for Ajax?
Web 2.0 applications can be hacked by exploiting a security hole in the JavaScript component of Ajax, according to security vendor Fortify Software...
- JQuery 1.4 goes live
jQuery JavaScript library brings performance and coding improvements. This release represents a significant update to the...
- Book excerpt: Using the Ajax.NET Pro Library
This chapter looks at the Ajax.NET Professional Library, an open-source framework that saves .NET developers from rewriting code to make it available...
- Ajax Learning Guide
Chances are, you've been doing JavaScript and XML developer work in Lotus Domino for quite some time. This old/new approach is causing quite a stir in...
- Ajax seen solving JavaScript issues for RIA
For rich Internet application (RIA) development, Ajax is doing for JavaScript what JavaScript couldn't do alone, the author argues. "The browser wars...
I think a Web developer should care about multiple requests (disabling forms, buttons, links when is necesary and not allowing multiple redundant interactions with the same element at the “same time” for each user).
This library seems to be cool but we need secure, safe and optimized applications too … this is the Web, with its “old” protocol and not a C++ asynchronous interaction.
It’s only my humil opinion.
Well, at least someone has spent a lot of time not learning JavaScript naming conventions…
The code snipplet was entirerly unintelligible. I sincerly hope it’s been taken out of context.
Here are Javascript threads:
http://www.javascript-examples.com/javascript-threads/
my own queue/batch-ajax-framework seems to be much more easy to use…anyway.
What a bunch of crappy code, this can be done so much easier!
Sometime, it’s an important thing to control functions’ order. And javascript-threads will be one of the important parts of RIA framework.
I search google, and find a thread class including start, sleep, suspend, resume, … That’s great! I will use it in asyc ajax callback.
Just curious. Not sure I understand the point. HTTPRequest is an HTTP communication standard, and is actually not a part of JavaScript. The HTTPRequest object is really just a “facade” that JavaScript slaps onto the low-level functionality, like the “system()” calls in C.
HTTPRequest is only capable of handling a single request at a time per window/frame. That’s not a JavaScript limitation. It’s an HTTP limitation. I looked at some of the “threading” stuff, and it all winds up doing the same thing “under the hood.”
This is simply a low-level interface to that. It is meant to act as a “driver,” and uses pretty much the same techniques you’d use in a UART driver. If you want to add “threading” to it, then you simply create a wrapper, and this takes care of the lower level. Consider this to be a “Transport layer” in the OSI model (Like the “TCP” in “TCP/IP”).
It really shouldn’t be considered equivalent to C++ threading, but could be used as a basis for that. The whole idea of a layered approach to communications is to make each layer’s quirks and limitations opaque. This is simply a facade to some of the limitations of HTTPRequest.
I’m sorry that it seems scary. If the code snippet shown to you in the example here is frightening, then BY NO MEANS should you look at the main JavaScript file. You’d never recover.
The Ajax Queue Class works, is reliable, and simple to use. It has saved me a lot of time when setting up a site quickly. Thanks, Chris.