html 用于页面JavaScript日志的模板
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 用于页面JavaScript日志的模板相关的知识,希望对你有一定的参考价值。
<html>
<head>
<title>Log</title>
<style type="text/css" media="all">
#log {
padding:0.5em;
overflow:auto;
font-family:"Envy Code R", "Consolas", "DejaVu Sans Mono", "Anonymous Pro", "Courier New", monospace;
font-size:80%;
background-color:#EEE;
color:#000;
}
#log div {
transition-property:background-color, color;
transition-duration:0.75s, 0.25s;
transition-delay:0.01s, 0.2s;
}
#log div:hover {
background-color:#AAA;
color:#FFF;
}
</style>
<script type="text/javascript">
function log(entry, appendToTop){
var log = document.getElementById("log"),
existing = log.innerHTML;
log.innerHTML = appendToTop ? "<div>"+entry+"</div>"+existing : existing+"<div>"+entry+"</div>";
}
</script>
</head>
<body>
<div id="log"></div>
</body>
</html>
以上是关于html 用于页面JavaScript日志的模板的主要内容,如果未能解决你的问题,请参考以下文章