1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
var activeDebugDiv=false;
(function(){
div = document.createElement("div");
div.setAttribute('style',"position:absolute;bottom:0px;width:100%;height:250px;background:#55B2B9;overflow:auto;");
activeDebugDiv=div;
document.body.appendChild(activeDebugDiv);
})();
var jDebug = function(className) {
this.debug = function (mes,arg) {
(function () {
if (!activeDebugDiv)
setTimeout(function() {debug(mes,arg);},1);
else {
if (mes) {
if (typeof console!="undefined" && typeof console.log!="undefined")
console.log(mes+"\n",arg);
//if (ajaxInclude.activeDebugIsEnabled) {
var div = document.createElement("div");
div.setAttribute('style',"background:#ABC2DE;margin:3px;padding:2px;");
div.innerHTML=mes+"<br/>\n";
var ser = document.createElement("div");
ser.setAttribute('style',"background:#555A60;margin:3px;padding:2px;");
div.appendChild(ser);
activeDebugDiv.appendChild(div);
if (arg) {
(function(){
//ici la fonction document.createELement n'existe plus????????????????????????
div = document.createELement("div");
div.setAttribute("style","margin:3px;padding:2px;");
div.innerHTML="esssai<br/>\n";
contener.appendChild(div);
})();
}
//}
}
}
})();
};
var debug=this.debug;
this.create = function(newClassName) {
return (new jDebug(className+"-"+newClassName)).debug;
};
};
myDebuger = new jDebug("ajaxInclude");
var debug = myDebuger.create("test");
debug("un");
debug("deux");
debug("trois");
debug("quatre",jDebug); |
Partager