js调试函数

参考php的debug函数修改了一下JS版的。 firebug 下使用控制台 ie使用 alert弹出

/**
 * 内部调试
 **/
function debug(v){
    if(window.console && window.console.log){
        window.console.log(v);
    }else{
        alert(v);
    }
}
  1. admin 说道:

    可以吗?

  1. There are no trackbacks for this post yet.

Leave a Reply