TypeError:e [h]不是函数 [英] TypeError: e[h] is not a function

查看:104
本文介绍了TypeError:e [h]不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用jquery 1.6没问题。今天我切换到jquery 1.8并突然在尝试提交表单时遇到此错误:

I've been using jquery 1.6 with no problem. Today I switched to jquery 1.8 and suddenly I am getting this error when trying to submit a form:

TypeError: e[h] is not a function.

表格:

<form method="post" action="login?login" name="login" id="login">
<input class="input" type="text" name="user_mail" id="user_mail" autocomplete="on" />
<input class="input" type="password" name="password" id="password" autocomplete="off" />
<a class="green_button" href="javascript:void(0)" id="login_button">Login</a>
<input type="submit" name="login" id="submit" style="visibility:hidden" />
</form>
<script language="javascript">
$("#login_button").click(function(){
    $("#login").submit();   
});
</script>

我错过了什么吗?

谢谢!

推荐答案

删除以下行。

<input type="submit" name="login" id="submit" style="visibility:hidden" />

更新:

Update:

或者如果你必须使用提交输入,那么你需要将id submit 更改为其他内容。原因是如果你有一个输入元素 id 提交,它将设置一个使用HTMLInputElement将属性提交到表单。因此,您无法在HTMLFormElement上调用 .submit 方法。

Or if you have to use the submit input, then you need to change the id submit to something else. The reason is that if you have an input element with id of submit, it will set a submit property to the form with the HTMLInputElement. So you could not call the .submit method on the HTMLFormElement.

这篇关于TypeError:e [h]不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆