【发布时间】:2013-10-15 02:43:52
【问题描述】:
Javascript 代码:
function doClick()
{
alert("clicked");
}
HTML 代码:
<div >
<table border="2" cellspacing="0" cellpadding="0" class="TextFG" style="font-family:Arial; font-size:10pt;">
<tr>
<td width="100%">
<table border="0" style="font-family:Arial; font-size:10pt;" cellspacing="0" cellpadding="3">
<tr>
<td> Find:</td>
<td nowrap>
<input type="text" id="Find_Text" name="Find_Text" size="7" > <input type="checkbox" name="Find_ExactMatch" value="1" checked>
</td>
<td colspan="2" style="cursor:default" nowrap >Exact Match</td>
</tr>
<tr>
<td> In:</td>
<td>
<select name="Find_DataFile">
<option value="1">Stage 1</option>
<option value="2">Stage 2</option>
</select>
</td>
<td align="center" valign="top">
<input type="submit" value="Go" onclick="doClick();"/>
</td>
<td align="center"><font class="DataFG">F2<font></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
大家好,
上面的简单代码不会在 Chrome(最新)中触发,但会在 IE8 和 IE10 下触发。 我做错什么了吗?。
感谢任何帮助 谢谢
在遍历我上面提供的代码中的每一行之后(其中还包括一个服务器请求以填充名为“Find_DataFile”的下拉列表,我无法提供其代码),我终于找到了导致对象不存在的罪魁祸首已定义错误(因为它的 id 未定义,我正在调用 getElementById 将其分配给临时对象)。现在都适用于 IE8 IE10 Chrome 和 Safari。感谢大家一直以来帮助我找到解决方案的时间和精力。非常感谢。我现在可以正常呼吸了哈哈!
【问题讨论】:
-
doClick()是您正在使用的实际函数名称,还是您针对问题更改了它? -
这是实际的函数名
-
作品Here
-
@ctaylor 当我说代码时,我指的是完整的代码。不是单独的 HTML 和 Javascript。能否请您将其作为单件发布。
标签: javascript html google-chrome