X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FNoAuth%2Fjs%2Fahah.js;h=5fcb47a19b33a05cfcca484316df3816d8f5714d;hb=fc6209f398899f0211cfcedeb81a3cd65e04a941;hp=b10b2714287d6610d075978f5ea4dad40b0ec11e;hpb=b4b0c7e72d7eaee2fbfc7022022c9698323203dd;p=freeside.git diff --git a/rt/share/html/NoAuth/js/ahah.js b/rt/share/html/NoAuth/js/ahah.js index b10b27142..5fcb47a19 100644 --- a/rt/share/html/NoAuth/js/ahah.js +++ b/rt/share/html/NoAuth/js/ahah.js @@ -1,9 +1,12 @@ /* % $r->content_type('application/x-javascript'); */ -// Fetched from http://www.opendarwin.org/~drernie/src/ahah.js - No Copyright - Public Domain +// originally Fetched from http://www.opendarwin.org/~drernie/src/ahah.js - No Copyright - Public Domain +// a patch fetched from http://www.xfront.com/microformats/examples/ahah/example01/ahah.js - see http://issues.bestpractical.com/Ticket/Display.html?id=14296 + function ahah(url, target, delay) { // document.getElementById(target).innerHTML = 'Loading '+url +'...'; + var req; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { @@ -20,7 +23,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 +34,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;