本月博客排行
-
第1名
duanfei -
第2名
benladeng5225 -
第3名
steven789654 - wddpwzzhao123
年度博客排行
-
第1名
龙儿筝 -
第2名
宏天软件 -
第3名
wy_19921005 - benladeng5225
- kaizi1992
- tanling8334
- vipbooks
- sam123456gz
- arpenker
- zysnba
- fantaxy025025
- wallimn
- e_e
- jh108020
- ganxueyun
- Xeden
- xyuma
- wangchen.ily
- zhanjia
- johnsmith9th
- zxq_2017
- forestqqqq
- jbosscn
- daizj
- xiangjie88
- xpenxpen
- 喧嚣求静
- lchb139128
- kristy_yy
- javashop
- lzyfn123
- sunj
- yeluowuhen
- ajinn
- lerf
- lemonhandsome
- chenqisdfx
- xiaoxinye
- flashsing123
- lyndon.lin
- bosschen
- zhangjijun
- sunnylocus
- lyj86
- paulwong
- sgqt
- hudiemeng870329
- 青否云后端云
- mft8899
- duanfei
最新文章列表
兼容console.log
在js前端开发时,为了调试经常会加上 console.log.但是在有的浏览器(比如IE)中会报错
怎么办呢?
在js文件最前面添加如下js代码:
if (window.console === undefined) {
console = {
log: function () {
}, info: function () {
} ...
简单修改nodejs中的console.log方法
var fs = require('fs');
var oldWrite = process.stdout.write;
process.stdout.write = function(d) {
fs.writeFile('log.txt', d);
oldWrite.apply(this, arguments);
};
重定向到一个文件中去。
Prevent IE crash console.log
origin
When the console is close and we call console.log from javascript most of the times Internet Explorer will crash with the message: Error:'console' is undefined
if (typeof console == 'undefin ...
IE8/9控制台命令
IE 从IE8之后也支持控制台命令了,并且个人觉得还挺好用的,基本上满足需求了。
以下列出它的几条命令,以及效果截图,供大家参考参考,也为自己留个笔记。
我个人觉得可以分为三类,一是控制台日志输出相关,二是window切换的命令,三是页面采样报告的两个命令。
1、控制台输出相关的命令:
console.log( msg, [, ... [, msgN ] ] ); //日志co ...