2 * author: Timothy Groves - http://www.brandspankingnew.net
3 * version: 1.0 - 2006-08-04
13 if (typeof(bsn) == "undefined")
30 _bsn.Ajax = function ()
38 _bsn.Ajax.prototype.makeRequest = function (url, meth, onComp, onErr)
44 this.onComplete = onComp;
49 // branch for native XMLHttpRequest object
50 if (window.XMLHttpRequest)
52 this.req = new XMLHttpRequest();
53 this.req.onreadystatechange = function () { pointer.processReqChange() };
54 this.req.open("GET", url, true); //
56 // branch for IE/Windows ActiveX version
58 else if (window.ActiveXObject)
60 this.req = new ActiveXObject("Microsoft.XMLHTTP");
63 this.req.onreadystatechange = function () { pointer.processReqChange() };
64 this.req.open(meth, url, true);
71 _bsn.Ajax.prototype.processReqChange = function()
74 // only if req shows "loaded"
75 if (this.req.readyState == 4) {
77 if (this.req.status == 200)
79 this.onComplete( this.req );
81 this.onError( this.req.status );