Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ajax 通过类或id选择时,jQuery表单提交不起作用_Ajax_Jquery - Fatal编程技术网

Ajax 通过类或id选择时,jQuery表单提交不起作用

Ajax 通过类或id选择时,jQuery表单提交不起作用,ajax,jquery,Ajax,Jquery,我有以下HTML和jQuery <form class='tform' method='post' action='/ajax/process'> .......... <button type = 'submit'>submit</button> </form> $(document).ready(function(){ $('.tform').bind('submit', function(e) {

我有以下HTML和jQuery

<form class='tform' method='post' action='/ajax/process'>
       ..........
<button type = 'submit'>submit</button>
</form>

$(document).ready(function(){

        $('.tform').bind('submit', function(e) {


                alert(8);
                e.preventDefault();
            });
});

..........
提交
$(文档).ready(函数(){
$('.tform').bind('submit',函数(e){
警觉(8);
e、 预防默认值();
});
});
使用类时,即使我使用live或bind,它似乎也不起作用。但是,如果我在使用live或bind时使用$('form'),它就可以工作。问题是我想使用类


谢谢大家。

请更正HTML标记,然后重试:

<button type='submit'>submit</button>
提交
不是这个:

<buttom type = 'submit'>submit</buttom>
提交

控制台中有错误吗?请检查一次。我想知道
buttom
而不是
button
的打字是否重要。我修复了发送提交事件的按钮中的语法错误。dosent mate,刚刚检查并更改为输入