www.mathertel.deThe AJAX EngineSamples 1: Async processing

AJAX Samples Part 1: Asynchronous Processing with JavaScript

Asynchronous processing, multithreading or paralell execution are no core features of the JavaScript interpreters we find in browsers today. But when building AJAX applications we need asynchronous techniques to offer the users a smart browsing experience.

These samples where made to show how to handle and use asynchronous processing in JavaScript and how to call a web server with native http without blocking.

This is the website with samples from May-June 2005 for my blog about aspects of AJAX. Details and more information is availabe in English on http://ajaxaspects.blogspot.com/ or in German on http://ajaxaspekte.blogspot.com/. Download all Sample files in a zip archive

Why asynchronous programming?

These samples are part of the background information about asynchronous processing possibilities and why AJAX is a good solution for implementing server-side processing. More details about this samples can be bound on my blog.

CalcFactorsOld.htm (view source)

CalcFactorsClient.htm (view source)

CalcFactorsAsync1.htm (view source)

CalcFactorsAsync2.htm (view source)

Native AJAX Programming

These samples show how AJAX processing can be used by using standard GET requests to the server. Because there are no web standards about returning data only from the server there is always some special coding necessary.

CalcFactorsServer1.htm (view source) This implementation shows how to get data from a webserver without using WebServices but a direct http-GET request.

CalcFactorsRequest.aspx (view source) is the server part of this sample.

It's possible to write AJAX appliactions this way but I think that impementing a new protocol for client-server web appliactions is not a good idea. Ther are too many protocols already and when implementing a new middleware I have to take care all myself that I do not open security holes etc.

CalcFactorsServer2.htm (view source) This is a implemetation that uses the same Server but works asynchronous.

Native AJAX Programming using a WebService

These samples shows how a WebService can be used for AJAX processing directly by explicitly coding all the necessary code for the communication in the page.

CalcFactorsServerSoap.htm (view source).

CalcService.asmx (view source) (view WSDL) This is the webservice used in this sample.

It's possible to directly call WebServices this way but I think that impementing a framework for calling WebServices and reusing this code is better.

Instead of building or a client- and server-side framework to bring down the amount of coding I fgound that building upon the WebService standards is a lot easier and will eliminate the need of building a new server-side framework.

Continue with the AJAX core Samples: ../S02_AJAXCoreSamples/Default.aspx


This page is part of the http://www.mathertel.de/ web site.