今天写了段ajax代码,ff运行ok,由于考虑多浏览器支持原因,用ie(ie8)运行了一下,按button报错错误提示如下
网页错误详细信息用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.4; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.1)
时间戳: Thu, 22 Apr 2010 11:04:06 UTC
消息: 对象不支持此操作
行: 11
字符: 1
代码: 0
URI: http://localhost:8080/myajax/myajax.htm

于是删除所有内容,只留空方法体,照样报错,
开虚拟机,ie6测试(不用服务器,直接运行),一样报错
怀疑start方法名问题,改名后运行ok。
代码如下<html>
<head>
<script type="text/javascript">
function start() {
  alert("");
}
</script>
</head>
<body>
<input type="button" value="button"  onclick="start()" /> 
</body>
</html>
问题已经解决,只是有点疑惑start是ie的内置属性还是什么?希望知情者告知~~

解决方案 »

  1.   

    已测试,果然是内部对像
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head><body>
    <input type="button" value="button"  onclick="javascript:alert(start);" /> 
    </body>
    </html>
    说是什么fileopen