Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I was wondering if I could clear up the console with some command..

(我想知道我是否可以用一些命令清理控制台..)

console.log() , can print... is there a command to clear up console?..

(console.log() ,可以打印...是否有清除控制台的命令?)

I've tried to console.log(console);

(我试过console.log(console);)

and got this functions below...

(并在下面有这个功能......)

assert: function assert() { [native code] }
constructor: function Console() { [native code] }
count: function count() { [native code] }
debug: function debug() { [native code] }
dir: function dir() { [native code] }
dirxml: function dirxml() { [native code] }
error: function error() { [native code] }
group: function group() { [native code] }
groupEnd: function groupEnd() { [native code] }
info: function info() { [native code] }
log: function log() { [native code] }
markTimeline: function markTimeline() { [native code] }
profile: function profile() { [native code] }
profileEnd: function profileEnd() { [native code] }
time: function time() { [native code] }
timeEnd: function timeEnd() { [native code] }
trace: function trace() { [native code] }
warn: function warn() { [native code] }
__proto__: Object

[ I guess there's no way to clear up the console... but I wanted someone to say it to me... ]

([我想没有办法清理控制台......但是我想让别人对我这么说......])

  ask by Reigel translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
214 views
Welcome To Ask or Share your Answers For Others

1 Answer

Update: As of November 6, 2012, console.clear() is now available in Chrome Canary.

(更新:截至2012年11月6日, console.clear() 现已在Chrome Canary中提供。)


If you type clear() into the console it clears it.

(如果在控制台中键入clear() ,则清除它。)

I don't think there is a way to programmatically do it, as it could be misused.

(我不认为有一种方法可以以编程方式执行,因为它可能被滥用。)

(console is cleared by some web page, end user can't access error information)

((控制台被某些网页清除,最终用户无法访问错误信息))

one possible workaround:

(一种可能的解决方法:)

in the console type window.clear = clear , then you'll be able to use clear in any script on your page.

(在控制台类型window.clear = clear ,然后您就可以在页面上的任何脚本中使用clear。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...