Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ajax constructor fixed for ie5.5 and 6

  • Loading branch information...
commit 105dcdbb82838fbecff26e851217123663ba9507 1 parent 1831dbc
James Halliday authored
Showing with 15 additions and 18 deletions.
  1. +14 −17 index.js
  2. +1 −1  lib/request.js
31 index.js
View
@@ -33,23 +33,20 @@ var xhrHttp = (function () {
'Microsoft.XMLHTTP'
];
for (var i = 0; i < axs.length; i++) {
- var res = (function (j) {
- try {
- var ax = new(window.ActiveXObject)(axs[j]);
- return function () {
- if (ax) {
- var ax_ = ax;
- ax = null;
- return ax_;
- }
- else {
- return new(window.ActiveXObject)(axs[j]);
- }
- };
- }
- catch (e) {}
- })(i);
- if (res) return res;
+ try {
+ var ax = new(window.ActiveXObject)(axs[i]);
+ return function () {
+ if (ax) {
+ var ax_ = ax;
+ ax = null;
+ return ax_;
+ }
+ else {
+ return new(window.ActiveXObject)(axs[i]);
+ }
+ };
+ }
+ catch (e) {}
}
throw new Error('ajax not supported in this browser')
}
2  lib/request.js
View
@@ -28,7 +28,7 @@ var Request = module.exports = function (xhr, params) {
});
xhr.onreadystatechange = function () {
- res.handle(this);
+ res.handle(xhr);
};
};
Please sign in to comment.
Something went wrong with that request. Please try again.