summaryrefslogtreecommitdiff
path: root/skins/common/ajax.js
diff options
context:
space:
mode:
Diffstat (limited to 'skins/common/ajax.js')
-rw-r--r--skins/common/ajax.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/skins/common/ajax.js b/skins/common/ajax.js
index 40065593..d90bea09 100644
--- a/skins/common/ajax.js
+++ b/skins/common/ajax.js
@@ -10,30 +10,30 @@ var sajax_request_type = "GET";
*/
function sajax_debug(text) {
if (!sajax_debug_mode) return false;
-
+
var e= document.getElementById('sajax_debug');
-
+
if (!e) {
e= document.createElement("p");
e.className= 'sajax_debug';
e.id= 'sajax_debug';
-
+
var b= document.getElementsByTagName("body")[0];
-
+
if (b.firstChild) b.insertBefore(e, b.firstChild);
else b.appendChild(e);
}
-
+
var m= document.createElement("div");
m.appendChild( document.createTextNode( text ) );
-
+
e.appendChild( m );
-
+
return true;
}
/**
-* compatibility wrapper for creating a new XMLHttpRequest object.
+* compatibility wrapper for creating a new XMLHttpRequest object.
*/
function sajax_init_object() {
sajax_debug("sajax_init_object() called..")
@@ -51,7 +51,7 @@ function sajax_init_object() {
A = new XMLHttpRequest();
if (!A)
sajax_debug("Could not create connection object.");
-
+
return A;
}
@@ -95,7 +95,7 @@ function sajax_do_call(func_name, args, target) {
alert("AJAX not supported");
return false;
}
-
+
try {
x.open(sajax_request_type, uri, true);
} catch (e) {
@@ -113,13 +113,13 @@ function sajax_do_call(func_name, args, target) {
x.onreadystatechange = function() {
if (x.readyState != 4)
return;
-
+
sajax_debug("received (" + x.status + " " + x.statusText + ") " + x.responseText);
-
+
//if (x.status != 200)
// alert("Error: " + x.status + " " + x.statusText + ": " + x.responseText);
//else
-
+
if ( typeof( target ) == 'function' ) {
target( x );
}
@@ -136,14 +136,14 @@ function sajax_do_call(func_name, args, target) {
else {
alert("bad target for sajax_do_call: not a function or object: " + target);
}
-
+
return;
}
-
+
sajax_debug(func_name + " uri = " + uri + " / post = " + post_data);
x.send(post_data);
sajax_debug(func_name + " waiting..");
delete x;
-
+
return true;
}