关于 "Uncaught TypeError: Property 'submit' of object #<HTMLFormElement> is not a function" 的解决方案
2012-08-29 16:14
1136 查看
今天遇到了一坑爹问题,发现外国网站上也有好多人在问,居然有人怀疑这是一个不为人知的bug。。
见代码:
如果点提交的话,会有这样的报错:
其实呢,其实呢。。这一切都是因为你type写了button,name写了submit的原因,把name改成button就ok了~~
这样的话在xxx()里写form.submit()就不会报错了
见代码:
<input type="button" name="submit" onclick="xxx()" />
<script type="text/javascript"> xxx(){ form.submit(); } </script>
如果点提交的话,会有这样的报错:
"Uncaught TypeError: Property 'submit' of object #<HTMLFormElement> is not a function"
其实呢,其实呢。。这一切都是因为你type写了button,name写了submit的原因,把name改成button就ok了~~
这样的话在xxx()里写form.submit()就不会报错了
相关文章推荐
- Property 'submit' of object #<HTMLFormElement> is not a function
- Property 'submit' of object #<HTMLFormElement> is not a function
- Property 'submit' of object #<HTMLFormElement> is not a function
- 关于Uncaught TypeError: type is not a function at HTMLAnchorElement.onclick (indexjsp:71)的解决
- Uncaught TypeError: XX is not a function at HTMLInputElement.onclick
- js错误:Uncaught TypeError: accept is not a function at HTMLInputElement.onclick
- Uncaught TypeError: Object #<HTMLDivElement> has no method 'attr'
- JS监听事件错误:Uncaught TypeError: xx(函数名)is not a function at HTMLInputElement.onclick
- Uncaught TypeError: XX is not a function at HTMLInputElement.onclick
- Uncaught TypeError: download is not a function at HTMLAnchorElement.onclick (index.html:25)
- JS异常处理:Uncaught TypeError: xxx is not a function at HTMLAnchorElement.onclick
- 关于JavaScript一个错误 Uncaught TypeError: form.submit is not a function
- Uncaught TypeError: $(...).Validform is not a function
- Backbone 或 jQuery 出错,异常:Uncaught TypeError: object is not a function
- Sea.js出现Uncaught TypeError: object is not a function的解决方法
- chrome浏览器Uncaught TypeError: object is not a function问题解决
- 关于Jquery错误的解决:Uncaught TypeError: $.post is not a function
- chrome浏览器Uncaught TypeError: object is not a function问题解决
- chrome浏览器Uncaught TypeError: object is not a function问题
- Uncaught TypeError: object is not a function