<form action="" type="get" id="form">
<input type="button" name="submit" id="subBtn" value="submit">
</form>

点击按钮,触发表单提交:

document.getElementById("subBtn").onclick=function(){
document.getElementById("form").submit();
}

会报错(chrome下):

Uncaught TypeError: Property 'submit' of object #<HTMLFormElement> is not a function

原因是name="submit"这句,换成别的name=sb1,sb2,sb2。。。

另外,经测,将id="submit",也会这样

同理,用于reset

一句话!!:

在表单里,别用name="submit|reset" 或  id="submit|reset"

ps:今天遇到了此错误,纠结了半天,记录一下,以警醒。

Property 'submit' of object #<HTMLFormElement> is not a function的更多相关文章

  1. 2.mongoDB add user in v3.0 问题的解决(Property 'addUser' of object admin is not a func)

    问题:创建mongodb帐户时,出错 > db.addUser('jyu', 'aerohive')  2015-08-05T20:03:02.767+0800 E QUERY    TypeE ...

  2. Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' ...

  3. Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解决方法

    发现问题 运行一下以前的一个Vue+webpack的 vue仿新闻网站  小项目,报错 由于自己vue学习不深入,老是这个报错,找了好久(确切的说是整整一下午^...^)才找到原因 -v- Uncau ...

  4. [one day one question] webpack 打包报错 Cannot assign to read only property 'exports' of object '#<Object>'

    问题描述: webpack 打包报错 Cannot assign to read only property 'exports' of object '#<Object>',这怎么破? 解 ...

  5. Vue 使用自定义组件时报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    自己试做了一下vue的插件 参考element-ui: 写了一个组件 import message from './packages/message/index.js'; const install ...

  6. Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' 点开错误的文 ...

  7. vue运行报错error:Cannot assign to read only property 'exports' of object '#<Object>'

    用weex做项目的时候,npm start 之后一直报错error:Cannot assign to read only property 'exports' of object '#<Obje ...

  8. 在Vue中使用i18n 国际化遇到 Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

    最近用Vue在搭建前端框架,在引用i18n时,运行的时候报错:Uncaught TypeError: Cannot assign to read only property 'exports' of ...

  9. Cannot assign to read only property 'exports' of object '#<Object>' ,文件名大小写问题!!!

    有些坑不知道怎么就掉进去,可能一辈子都爬不起来!!! 一.错误描述 昨天还好好的,今天早上来从git获取了一下别人提交的代码就出错了!而提交代码的人 运行一点错误都没有!!! cya@KQ-101 M ...

随机推荐

  1. 翻译:Addressing tiles: same tile bounds with different indexes

    原文链接:http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/ Addressing tiles: same ...

  2. Randcher 2.0部署K8s集群(一)

    环境准备 1.系统版本 CentOS7.5 + docker ee 2.配置阿里云yum源 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirro ...

  3. MySQL多个相同结构的表查询并把结果合并放在一起的语句(union all)

    union all select *,'1' as category from table1001 where price > 10 union all select *,'2' as cate ...

  4. Ajax保留浏览器历史的两种解决方案(Hash&Pjax)

    总是在github down点东西,github整个界面做的不错,体验也很好~对于其中的源代码滑动的特效最为喜欢了~刚开始以为这个只是普通的ajax请求效果,但是发现这个特效能够导致浏览器地址栏跟随变 ...

  5. 排序问题Java

    package zhuzhuangtu; import java.util.*; import java.io.*; public class Main{ public static void mai ...

  6. cocos-lua基础学习(八)Layer类学习笔记

    创建 local layer = cc.Layer:create() local layer1 = cc.LayerColor:create(cc.c4b(192, 0, 0, 255), s.wid ...

  7. python 字节字符串上的字符串操作

    问题:想在字节字符串上执行普通的文本操作(比如移除,搜索和替换). 解决方案 1)字节字符串同样也支持大部分和文本字符串一样的内置操作.比如: >>> data = b'Hello ...

  8. Python 以指定列宽格式化字符串

    问题: 有一些长字符串,想以指定的列宽将他们重新格式化 解决方案: 使用textwrap模块来格式字符串的输出. textwrap 模块对于字符串打印时非常有用的,特别是当希望输出自动匹配终端大小的时 ...

  9. TED #06# Questioning the universe

    Stephen Hawking: Questioning the universe 1. 第一段: There is nothing bigger or older than the universe ...

  10. SQL学习笔记之项目中常用的19条MySQL优化

    在写文章之前,首先感谢 飞友科技 陆老师提供的文档.. 声明一下:下面的优化方案都是基于 “ Mysql-索引-BTree类型 ” 的 0x00 EXPLAIN 做MySQL优化,我们要善用 EXPL ...