YAOHAIXIAO.COM

FOCUS ON JAVASCRIPT

YLogger v1.1.0 Beta

程序开发:YAOHAIXIAO.COM发表时间:2010 - 01 - 23

程序简介

YLogger v1.1.0 Beta,这个小程序也是大概是两年前写的,在Messagebox模拟提示框效果后写的,就是为了方便开发AJAX程序的调试用的。在页面中直接加载Logger跟踪框,免去了使用alert()方法在循环时不停点击的烦恼。今天花了点时间也用YaoUI重新写了下,但是还是没有做任何的优化。不过已经可以适应一般的调试提示信息了。当然绝对没有firebug或者firebug lite那么牛,但是也算是自己开发工具的一个初步的尝试吧。

调用方法

第一步:在页面中调用yao.js文件,例如:

<script type="text/javascript" src="js/yao.js"></script>

第二步:编写调用代码:

/*
 * 在需要调试的地方加入相应的log信息就可以了
 * info/msg - 普通信息
 * accept - 正确信息
 * warn - 警告信息
 * error - 错误信息
 */
(function(){
    YAO.Logger.log('The window, strings and functions also have', 'info', 'http://www.yaohaixiao.com/js/core.js');
    YAO.Logger.log('The window, strings and functions also have', 'accept', 'http://www.yaohaixiao.com/js/core.js');
    YAO.Logger.log('The window, strings and functions also have', 'warn', 'http://www.yaohaixiao.com/js/core.js');
    YAO.Logger.log('The window, strings and functions also have', 'error', 'http://www.yaohaixiao.com/js/core.js');
    YAO.Logger.log('The window, strings and functions also have', 'msg', 'http://www.yaohaixiao.com/js/core.js');
    YAO.Logger.log('The window, strings and functions also have', 'info', 'http://www.yaohaixiao.com/js/core.js');
    YAO.Logger.log('The window, strings and functions also have', 'accept', 'http://www.yaohaixiao.com/js/core.js');
    YAO.Logger.log('The window, strings and functions also have', 'warn', 'http://www.yaohaixiao.com/js/core.js');
    YAO.Logger.log('The window, strings and functions also have', 'error', 'http://www.yaohaixiao.com/js/core.js');
    YAO.Logger.log('The window, strings and functions also have', 'msg', 'http://www.yaohaixiao.com/js/core.js');
})();
	

程序代码

Download:ylogger.rar

个人简介

yaohaixiao
  • 姓名:姚海啸
  • 年龄:28岁
  • 学历:大专
  • 职业:前端工程师
奋斗目标:成为顶尖的前端工程师

我的作品

订餐小秘书官网 荆楚网新闻频道首页 爱唱久久官网 武汉联通互动CLUB

Copyright © 2008-2009 yaohaixiao.com, All right reserved.