includes/clientside/static/functions.js
changeset 827 2c20563245b2
parent 823 4596c40aaa94
child 832 7152ca0a0ce9
--- a/includes/clientside/static/functions.js	Sun Jan 25 21:20:14 2009 -0500
+++ b/includes/clientside/static/functions.js	Sun Jan 25 21:21:07 2009 -0500
@@ -105,16 +105,20 @@
     editor_open = false;
     enableUnload();
   }
-  ajax = ajaxMakeXHR();
+  var ajax = ajaxMakeXHR();
   if ( !ajax )
   {
     console.error('ajaxMakeXHR() failed');
     return false;
   }
-  ajax.onreadystatechange = f;
+  ajax.onreadystatechange = function()
+  {
+    f(ajax);
+  };
   ajax.open('GET', uri, true);
   ajax.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
   ajax.send(null);
+  window.ajax = ajax;
 }
 
 function ajaxPost(uri, parms, f, call_editor_safe) {
@@ -133,13 +137,16 @@
     editor_open = false;
     enableUnload();
   }
-  ajax = ajaxMakeXHR();
+  var ajax = ajaxMakeXHR();
   if ( !ajax )
   {
     console.error('ajaxMakeXHR() failed');
     return false;
   }
-  ajax.onreadystatechange = f;
+  ajax.onreadystatechange = function()
+  {
+    f(ajax);
+  };
   ajax.open('POST', uri, true);
   ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
   // Setting Content-length in Safari triggers a warning
@@ -149,6 +156,7 @@
   }
   ajax.setRequestHeader("Connection", "close");
   ajax.send(parms);
+  window.ajax = ajax;
 }
 
 /**