恢复console.log() [英] Restoring console.log()

查看:209
本文介绍了恢复console.log()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,随附 Magento 的原型框架(或其他JavaScript代码)正在取代标准的控制台功能,所以我无法调试任何东西。在JavaScript控制台写下 console 我得到以下输出:

For some reason, the prototype framework (or another JavaScript code) that is shipped with Magento is replacing standard console functions, so I can't debug anything. Writing down in JavaScript console console I get the following output:

> console
Object
assert: function () {}
count: function () {}
debug: function () {}
dir: function () {}
dirxml: function () {}
error: function () {}
group: function () {}
groupEnd: function () {}
info: function () {}
log: function () {}
profile: function () {}
profileEnd: function () {}
time: function () {}
timeEnd: function () {}
trace: function () {}
warn: function () {}

我在Linux上使用 Google Chrome版本13.0.782.112

I'm using Google Chrome version 13.0.782.112 on Linux.

原型JavaScript框架,版本1.6.0.3

是否有快速解决此问题的方法?

Is there a quick way to solve this?

推荐答案

例如,

For example,

delete console.log

也可以恢复 console.log

console.log = null;
console.log;         // null

delete console.log;
console.log;         // function log() { [native code] }

这篇关于恢复console.log()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆