본문 바로가기
Web Program/Html Lecture

스크립터 디버거

by 현이빈이 2008. 9. 4.
반응형
/** * <!-- script :script -->* <!-- script * //... * log("...@#@$&*^#$..."); * //... * :script -->*/ var oLogWin, oLogger; var lPreTime; function makeLogger(oLogWin, sID) { var oLogDoc = oLogWin.document; var oTextArea = oLogDoc.getElementById(sID); if (!oTextArea) { oTextArea = oLogDoc.createElement("TEXTAREA"); oLogDoc.body.insertBefore(oTextArea,null); oTextArea.id = sID; oTextArea.style.height = oLogDoc.body.clientHeight - 20; oTextArea.style.width = oLogDoc.body.clientWidth; oTextArea.style.font = "9pt Arial"; } return oTextArea; } function log(str, bTime) { if (!oLogWin || oLogWin.closed) { oLogWin = window.open("","LogWin","top=5,left=5,width=350,height=400,resizable"); oLogDoc = oLogWin.document; var sScript = "<table width=100% cellpadding=0 cellspacing=0 border=0 align=center style='font-size:9pt'><tr>" + "<td align=left style='padding-left:10;height:20;font-weight:700'>Script Loggger</td>" + "<td align=right style='padding-right:10'>" + "<!-- badtag filtered --><span>clear</span>" + "</td></tr></table>"; 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 + "\t> " + str + "\n"; oLogger.scrollTop = oLogger.scrollHeight - oLogger.clientHeight; }
반응형