gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 06:05:57 25 4
gpt4 key购买 nike

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

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com