Recent Blog Posts
Blogs ยป Archive for September 12th, 2006
Eliminating async Javascript callbacks by preprocessing
The Catch 22 of AJAX is, for the sake of an easy life, most of the time we want to write “synchronous code” but asynchronous is the only way to avoid some rather nasty usability issues. This means rather than being able to write simple code, as we’d like to, such as;
function doClick() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open(”GET”,”http://example.com/products”,false);
# Execution blocks here, waiting for the response to complete…
xmlhttp.send(null);
alert(xmlhttp.responseText);
}
…we’re required instead to handle this via callbacks, the simplest example being…
var xmlhttp = new XMLHttpRequest();
function doClick() {
xmlhttp.open(”GET”,”http://example.com/products”,true);
// Set the callback
xmlhttp.onreadystatechange = handleResponse;
xmlhttp.send(null);
}
function handleResponse() {
if ( xmlhttp.readyState == 4 ) {
alert (xmlhttp.responseText);
}
}
…but that’s now introduced a whole load more potential issues. The callback now relies on the global xmlhttp object being available (and globals for any significant size project are generally evil). And what if the user keeps firing that doClick() function? What about async requests that pause for a …
Sep 11, 2006 News Wire
-
Live Filter: Re-inventing Search
A new design pattern for search engines that revolves around progressive filtering of results, rather than a single query. The Implementation section is especially interesting, as it covers some of the ugly browser issues still facing AJAX developers.
(tags: design usability rubyonrails ajax) -
Webified Desktop Apps vs Browser-based Apps
Covering similar ground to my editorial in Tech Times #146, this article proposes that the future of desktop computing is not in AJAX, but in desktop applications that are enhanced to take advantage of Internet-based resources.
(tags: ajax programming) -
Web-based Media Sharing Software ccHost 3.0 Released Today
Produced by Creative Commons, ccHost is an open source web application for sharing media files online and building collaborative communities around them. The 3.0 release includes many significant new features. ccHost is written in PHP.
(tags: software php) -
Apache + Chroot + FastCGI + PHP FAQ
Are you managing a single server that hosts multiple PHP web applications using virtual hosts? By configuring your server using Chroot and FastCGI, you can net big gains in both performance and security.
(tags: apache php) - Court Denies Target Corp. …
Catching Session Timeouts before they Bite
Using sessions to store user information is a very handy feature of ASP.NET. But it is not without its dark side. One of the principal difficulties is the fact that sessions can die unexpectedly. This can happen for a number of reasons. It could just time out. The server could decide it needs to recycle the application. A user could clear his session cookies. There could be a sunspot. And here is how to catch these events before you corrupt your database.
Sponsored Links
SitePoint Marketplace
Buy and sell Websites, templates, domain names, hosting, graphics and more.