Home > Backend Development > PHP Tutorial > 调试程序的时候暴露在console的参数信息不清除有什么危害?

调试程序的时候暴露在console的参数信息不清除有什么危害?

WBOY
Release: 2016-06-06 20:35:02
Original
1104 people have browsed it

我喜欢用console.log 调试输出XHR信息,上线的时候也这样,不知道有没有危害?

回复内容:

我喜欢用console.log 调试输出XHR信息,上线的时候也这样,不知道有没有危害?

有些浏览器不支持console的话,你的js执行就会报错了。。。

<code>var DEBUG=true;
if(!DEBUG) window.console={log:function(){}};
</code>
Copy after login

有危害,在ie下会报错,导致程序无法运行

打开tmall,按F12,打开console页面看看

低版本IE内核是没有console的

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template