Make the XHR abstraction shorter
Written by on April 18th, 2007 in Ajax News.
In low-level land, the try/catch trick that Prototype uses was king for ‘most fun way to get the XHR object’.
Nicolas Faugout has put his hat in the ring with:
JAVASCRIPT:
-
-
if (!XMLHttpRequest) {
-
function XMLHttpRequest() {
-
return new ActiveXObject(’Microsoft.XMLHTTP’);
-
}
-
}
-
This feels like the Just Another Perl Hacker hacks in Perl land. Next we will see examples with rot13.
Source: Ajaxian
Original Article: http://ajaxian.com/archives/make-the-xhr-abstraction-shorter