Javascript 如何从ajax回调提交表单
在理解ajax的过程中,我遇到了这个问题,我不知道如何解决它,首先我请求表中的数据Javascript 如何从ajax回调提交表单,javascript,jquery,ajax,Javascript,Jquery,Ajax,在理解ajax的过程中,我遇到了这个问题,我不知道如何解决它,首先我请求表中的数据 load_data(); function load_data(page) { $.ajax({ url:"data.php", method:"POST", data:{page:page}, success:function(
load_data();
function load_data(page)
{
$.ajax({
url:"data.php",
method:"POST",
data:{page:page},
success:function(data){
$('#result').html(data);
},
error:function(exception){alert('Exeption:'+exception);}
})
}
这就是它将被输出的表
<table>
<thead>
<tr>
<th>name</th>
<th>details</th>
<th>price</th>
<th></th>
</tr>
</thead>
<tbody id = "result">
通过单击按钮将id添加到需要提交的表单中
<form id="myForm1">
//Other Code Here
哪里是
add\u details
逻辑的其余部分在哪里?何时/何地执行加载数据()?为什么不是父级而不是父级?
<form id="myForm1">
//Other Code Here
$(document).on('click', '#add_details', function(){
$("#myForm1").submit();
});