스크립트 디버거

자바스크립트는 디버깅하기 정말 고통스럽죠?

alert 남발하기 싫으신 분들만 쓰세욤… ㅡ.ㅡa

 

/*** <script src="logger.js"></script>* <script>* //...* log("...&#64;#&#64;$&*^#$...");* //...* </script>*/var oLogWin, oLogger;var lPreTime;function makeLogger(oLogWin, sID) {var oLogDoc = oLogWin.document;var oTextArea = oLogDoc.getElementById(sID);if (!oTextArea) {oTextArea = oLogDoc.createElement(&ldquo;TEXTAREA&rdquo;);oLogDoc.body.insertBefore(oTextArea,null);oTextArea.id = sID;oTextArea.style.height = oLogDoc.body.clientHeight &ndash; 20;oTextArea.style.width = oLogDoc.body.clientWidth;oTextArea.style.font = &ldquo;9pt Arial&rdquo;;}return oTextArea;}function log(str, bTime) {if (!oLogWin || oLogWin.closed) {oLogWin = window.open(&ldquo;&rdquo;,&rdquo;LogWin&rdquo;,&rdquo;top=5,left=5,width=350,height=400,resizable&rdquo;);oLogDoc = oLogWin.document;var sScript = &ldquo; “+ “

“+ “

Script Loggger “+ “clear“+ “

“;oLogDoc.write(sScript);oLogDoc.body.style.margin = “0,0,0,0”;oLogger = makeLogger(oLogWin, “LogArea”);lPreTime = new Date().getTime();}var sTime = new Date().getTime() – lPreTime;if (bTime) {lPreTime = new Date().getTime();}oLogger.value += “time : ” + sTime + ” > ” + str + ”
“;oLogger.scrollTop = oLogger.scrollHeight – oLogger.clientHeight;}

Leave a Reply