[PATCH] Make req a local variable instead of a global one (did not work well when there are multiple custom fields that have a value for IncludePage)

Bram rtdevel at lists.wizbit.be
Thu Dec 24 04:37:32 EST 2009


---
 share/html/NoAuth/js/ahah.js |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/share/html/NoAuth/js/ahah.js b/share/html/NoAuth/js/ahah.js
index b10b271..eb96a8e 100644
--- a/share/html/NoAuth/js/ahah.js
+++ b/share/html/NoAuth/js/ahah.js
@@ -4,6 +4,7 @@
 // Fetched from http://www.opendarwin.org/~drernie/src/ahah.js - No Copyright - Public Domain
 function ahah(url, target, delay) {
   // document.getElementById(target).innerHTML = 'Loading <a href="'+url+'">'+url +'</a>...';
+  var req;
   if (window.XMLHttpRequest) {
     req = new XMLHttpRequest();
   } else if (window.ActiveXObject) {
@@ -20,7 +21,7 @@ function ahah(url, target, delay) {
   }
 
   if (req != undefined) {
-    req.onreadystatechange = function() {ahahDone(url, target, delay);};
+    req.onreadystatechange = function() {ahahDone(req, url, target, delay);};
     if ( use_get == 1 ) {
         req.open("GET", url, true);
     }
@@ -31,7 +32,7 @@ function ahah(url, target, delay) {
   }
 }  
 
-function ahahDone(url, target, delay) {
+function ahahDone(req, url, target, delay) {
   if (req.readyState == 4) { // only if req is "loaded"
     if (req.status == 200) { // only if "OK"
       document.getElementById(target).innerHTML = req.responseText;
-- 
1.5.4.3


--=_4ca93rjophic--



More information about the Rt-devel mailing list