Author: eallen
Date: 2008-10-14 16:49:59 -0400 (Tue, 14 Oct 2008)
New Revision: 2638
Modified:
mgmt/trunk/cumin/resources/wooly.js
Log:
Fixing javascript so multiple concurrent ajax requests can be made
Modified: mgmt/trunk/cumin/resources/wooly.js
===================================================================
--- mgmt/trunk/cumin/resources/wooly.js 2008-10-14 20:49:17 UTC (rev 2637)
+++ mgmt/trunk/cumin/resources/wooly.js 2008-10-14 20:49:59 UTC (rev 2638)
@@ -199,19 +199,23 @@
}
function Wooly() {
- if (window.XMLHttpRequest) {
- this.request = new XMLHttpRequest();
- }
- else {
- if (window.ActiveXObject) {
- try {
- this.request = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {
- this.request = new ActiveXObject("Msxml2.XMLHTTP");
+ this.getNewRequest = function() {
+ var request;
+ if (window.XMLHttpRequest) {
+ request = new XMLHttpRequest();
+ }
+ else {
+ if (window.ActiveXObject) {
+ try {
+ request = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e) {
+ request = new ActiveXObject("Msxml2.XMLHTTP");
+ }
}
}
+ return request;
}
-
+
this.assert = assert;
this.log = log;
this.dir = dir;
@@ -223,7 +227,7 @@
this.deferredUpdate = function(url, callback, passback) {
- var req = this.request;
+ var req = this.getNewRequest();
req.open("get", url, true);
req.onreadystatechange = update;
@@ -244,7 +248,7 @@
}
this.setIntervalUpdate = function(url, callback, interval) {
- var req = this.request;
+ var req = this.getNewRequest();
function fetch() {
req.open("get", url, true);