Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 网站建设 > ASP > JavaScript logger: Lumberjack
【标  题】:JavaScript logger: Lumberjack
【关键字】:JavaScript,logger,Lumberjack
【来  源】:http://blog.csdn.net/Haohappy2004/archive/2006/12/26/1462038.aspx

JavaScript logger: Lumberjack

Your Ad Here

As you know,it is difficult to debug a javascript app.Sometimes we use the rough alert() function (to output the error messages),but it's not  suitable for complex situations and it will stop the script. So, we need some logging frameworks,which are more powerful than alert().

Corey Johnson's Lumberjack is a Javascript logging framework which supports logging at different levels. There's no setup required, because it creates the logging div itself, so you can immediately issue calls like Logger.info("User logged in."). The console is initially hidden, and you can toggle visibility with Alt-D.

It's useful for AJAX applications,you could see what is the scirpt doing at a cert moment. Here is a screenshot :

 

And the sample source code:

function ping() {
 // Send ping, to let the server know I'm still here
 var url = base_url + 'ping.php';
 var pars = creds();

 var ajax = new Ajax.Request(url, {method: 'post', parameters: pars, onComplete: handle_ping});

 Logger.info("Sent Ping: " + pars);
}

 

呵呵,工作较忙,发个东西给大家看看!:【上一篇】
模式修正符:【下一篇】
【相关文章】
  • 在JavaScript中调用WebService
  • javascript总结--div
  • javascript在静态页面上接受参数的方法
  • javascript总结--cookie篇
  • javascript escape/unescape编码的Java实现
  • JAVAScript 中的存放常量的文件adojavas.inc
  • 重写与扩展 JScript/Javascript String 对象的 HTML 函数 By shawl.qiu
  • 扩展JavaScript的时候,千万要保留其原来的所有功能
  • shawl.qiu Javascript 语法高亮函数 v1.1
  • Windows Mobile 5.0 (3) -- 在Mobile Web Form中使用javascript
  • 【随机文章】
  • 理解HashMap
  • 媒体的文字版和网络版各有优点
  • 如何让你的程序运行的更快(1)之续---揭秘StringBuffer的capacity
  • Marvell以2.25亿美元收购QLogic存储芯片业务
  • oracle日期函数
  • Oracle建立(基础)
  • Phalanger---PHP的.NET编译器
  • redhat9键盘快捷操作
  • 宽带用户市场细分初步分析
  • 北京招聘.net开发人员
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 软讯网络 All Rigths Reserved.