我写了一个简单的 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/