summaryrefslogtreecommitdiff
path: root/itjs
diff options
context:
space:
mode:
Diffstat (limited to 'itjs')
-rw-r--r--itjs/it.js42
1 files changed, 21 insertions, 21 deletions
diff --git a/itjs/it.js b/itjs/it.js
index 7fb02bc..413bad0 100644
--- a/itjs/it.js
+++ b/itjs/it.js
@@ -15,41 +15,41 @@ function CED(txt)
*/
function ED()
{
- var element = document.getElementById('jsdebug');
- if (element)
+ var element;
+ var text = "";
+
+ if (!(element = document.getElementById('jsdebug')))
+ var element = it_create_element(document.body, 'div', {id:'jsdebug', style:{position:'absolute', left:'100px', top:'10px', opacity:'0.8'}})
+
+ for (var i = 0; i < arguments.length; i++)
{
- var text = "";
+ var variable = arguments[i];
- for (var i = 0; i < arguments.length; i++)
- {
- var variable = arguments[i];
+ if (typeof variable == "string")
+ variable = variable.replace(/&/g, '&amp;').replace(new RegExp("<", "g"), '&lt;');
- if (typeof variable == "string")
- variable = variable.replace(/&/g, '&amp;').replace(new RegExp("<", "g"), '&lt;');
+ text += (typeof variable) + " " + variable;
- text += (typeof variable) + " " + variable;
+ if (typeof variable == "object")
+ {
+ text += ":";
- if (typeof variable == "object")
+ for (field in variable)
{
- text += ":";
-
- for (field in variable)
- {
- text += field + "=";
+ text += field + "=";
- try { text += typeof variable[field] == 'function' ? 'function' : variable[field]; }
- catch (e) { text += "*" + e + "*"; }
+ try { text += typeof variable[field] == 'function' ? 'function' : variable[field]; }
+ catch (e) { text += "*" + e + "*"; }
- text += "\n";
- }
text += "\n";
}
-
text += "\n";
}
- element.innerHTML += '<pre style="background-color:#FEE; margin:0">' + text + '<' + '/pre>';
+ text += "\n";
}
+
+ element.innerHTML += '<pre style="background-color:#FEE; margin:0">' + text + '<' + '/pre>';
}
/**