javascript.options.strict 编辑
JavaScript warnings are generated when code is executed that doesn't cause a run-time error, but is non-standard, poorly written, or prone to cause logic errors. This preference controls whether JavaScript warnings are logged to the JavaScript Console.
Example :
<html>
<head>
<title>Sample</title>
</head>
<body>
<label id="name">Enter you First Name</label>
<p id ="sample"></p>
<script>
"use strict"
name1= "John" ; // This will cause and an error as variable not declared .
var name2= "Peter";
document.getElementById("sample").innerHTML = name1;
</script>
</body>
</html>
Possible values and their effects:
True: Show JavaScript errors and warnings.
False: Show JavaScript errors only. (Default)
See also: http://kb.mozillazine.org/Javascript.options.strict
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论