javascript - "Evaluate"在 Mozilla firefox 和 google-chrome 中不能用作 javascript 函数名称

标签 javascript firefox google-chrome

我写了一个简单的 html 文件,只有一个 javascript 函数。它在 IE 中有效,但在 frefox 和 chrome 中无效。代码是:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head>
<title>test</title>
<script type="text/javascript">
function evaluate()
{
alert("Hello World!");
}
</script>
</head>
<body>

<form >
<table id="tbl">
 <tr align="right">
  <td><input  id="__JAVA_Evaluate" type="button" value="evaluate!" onclick="evaluate()"/>
  </td>
 </tr>
</table>
</form>
</body>
</html>

一段时间后,我了解到在 Firefox 和 chrome 中无法定义名为 evaluate() 的函数。 重命名函数就足够了。我想知道这是在 Firefox 和 chrome 中保留的其他函数名称,我们如何知道这个保留键?

最佳答案

关于javascript - "Evaluate"在 Mozilla firefox 和 google-chrome 中不能用作 javascript 函数名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4725936/

相关文章:

javascript - 为什么启用 Paint Flashing 会显着提高帧率?

javascript - 带有预填充的 HTML 表单不会在 Chrome 中提交

javascript - Math.Random() 选择随机数组

javascript - FabricJs 1.7.18 scaleToWidth() 未设置给定宽度

javascript - 使用 javascript 的事件 onclick 函数更改 img -- 已解决

javascript - HTML/JavaScript 脚本注入(inject)异常

css - 未应用计算样式

javascript - 如何更新 mongoose 中查询前或查询后 Hook 的文档?

javascript - 关闭另一个选项卡/窗口

firefox - Flash Builder 4.7 无法在 OS X 10.8.4 中启动 Firefox v21.0