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:

  1.  
  2. if (!XMLHttpRequest) {
  3.   function XMLHttpRequest() {
  4.     return new ActiveXObject(’Microsoft.XMLHTTP’);
  5.   }
  6. }
  7.  

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

Leave a Reply

You must be logged in to post a comment.



Site Navigation