$('.url_form_submit').click(function(){
var str_data=$(this).这里怎么取得当前点击按钮对应表单的所有input呢.map(function(){
return ($(this).attr("name")+'='+$(this).val());
}).get().join("&") ;
alert(str_data);
$.ajax({
type: 'POST',
async : false,
url: '/index.php/domain_admin/updataIframeUrl',
data: {domain_set:domain_set},
error:function(){
alert('请求错误');
},
success:function(data){
alert(data);
}
});
});
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
应该用form的submit事件而非submit按钮的click事件。这样this就直接指向form了
每一个form应该有一个submit,最好不要用这样的方式提交数据。如果你非要用这样的方式,可以用$('form[index]:input')(不确定是正确的) 这样的方式。
同意@HSFZXJY的