当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 使用新的消息弹出框blackbirdjs

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 使用新的消息弹出框blackbirdjs


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-12   浏览: 370 ::
收藏到网摘: n/a

Blackbird 是一个开源的JavaScript库,提供了一种简单的记录日志的方式和一个控制台窗口,有了这个之后,你就可以抛弃alert() 了。 jgyhuzhou 写道
BlackBird, G. Scott Olson开发的javascript日志记录库,相当于java中的log4j, javascript开发者再也不用使用alert来调试啦。
以下是具体的操作说明:
Html代码
复制代码 代码如下:

<html>
<head>
<script type="text/javascript" src="/PATH/TO/blackbird.js"></script>
<link type="text/css" rel="Stylesheet" href="/PATH/TO/blackbird.css" />
...
</head>
</html>
<html>
<head>
<script type="text/javascript" src="/PATH/TO/blackbird.js"></script>
<link type="text/css" rel="Stylesheet" href="/PATH/TO/blackbird.css" />
...
</head>
</html>

Blackbird有一个简单的方法将返回值发送到控制台:
Javascript代码
复制代码 代码如下:

log.debug( 'this is a debug message' );
log.info( 'this is an info message' );
log.warn( 'this is a warning message' );
log.error( 'this is an error message' );
log.debug( 'this is a debug message' );
log.info( 'this is an info message' );
log.warn( 'this is a warning message' );
log.error( 'this is an error message' );

这个方法的好处是,所有这些公共的方法都能独立的现实数据。可以很容易的确定发送邮件的类型:

支持下面的浏览器:
* Internet Explorer 6+
* Firefox 2+
* Safari 2+
* Opera 9.5
另外,如果你使用的是YUI的话,可以考虑YUI中的Logger组件
官方地址 http://www.gscottolson.com/blackbirdjs/