IE中使用JavaScript中调用form.submit()提示“对象不支持此属性和方法”问题研究
今天在项目中无意中遇到的一个神奇的问题,特此记录。
首先我们看看以下代码,测试页面可以看这里,页面的功能和逻辑很简单。
这段代码从逻辑上看没有任何错误和BUG,理论上是可以完全执行的。
<html>
<head>IE 测试</head>
<body>
<script language="javascript">
/*
======================================
IE 下 submit 重名测试
作者:朦朧中的罪惡
博客:http://be-evil.org
======================================
*/
function dosubmit()
{
var theform = document.getElementById('theform');
theform.submit();
}
</script>
<form method="post" id="theform">
<table width="800">
<tr>
<td><input type="text" value="测试"></td>
</tr>
<tr>
<td><input type="button" name="submit" value="提交" onclick="dosubmit()"></td>
</tr>
</table>
</form>
</body>
</html>

![附件[ematt:119]](http://be-evil.org/uploadfile/200808/thum-f3ccdd27d2000e3f9255a7e3e2c4880020080812090232.jpg)
![附件[ematt:120]](http://be-evil.org/uploadfile/200808/thum-156005c5baf40ff51a327f1c34f2975b20080812090232.jpg)
![附件[ematt:115]](http://be-evil.org/uploadfile/200807/9ddbc807d6013b2b205eb2b0055b8d6b20080710230450.jpg)
![附件[ematt:112] Gmail Loading](http://be-evil.org/uploadfile/200807/thum-c51d000baa082837c9061b55a5bcecfe20080709200013.jpg)
![附件[ematt:113] main](http://be-evil.org/uploadfile/200807/thum-aedb6e6943ddfbecf44e97b603f893ec20080709200146.jpg)

![附件[ematt:111]](http://be-evil.org/uploadfile/200807/thum-d7cb973efb292cd07434b36cda0336b920080704232417.jpg)
