c#mvc+ajax没反应!老是错误! 10
view:$("#u1038-4").click(function(){if($('#u1027-4').val()==''||$('#u1030-4').val()==...
view:
$("#u1038-4").click(function () {
if ($('#u1027-4').val() == '' || $('#u1030-4').val() == '' || $('#u1033-4').val() == '' || $('#u1036-4').val() == '') {
alert('请将信息填写完整!');
return false;
}
else
{
$.ajax(
{
type: 'post',
url: '/Home/Shopcar_save',
data: 'type=save',
success: function (data) {
alert('Your data have been saved!');
alert(data);
},
error: function (data) {
alert('Your data have been errored!');
}
});
}
});
controlled:
[HttpPost]
public void Shopcar_save(String type)
{
Response.Write("成功");
}
老是error!!!是什么问题! 展开
$("#u1038-4").click(function () {
if ($('#u1027-4').val() == '' || $('#u1030-4').val() == '' || $('#u1033-4').val() == '' || $('#u1036-4').val() == '') {
alert('请将信息填写完整!');
return false;
}
else
{
$.ajax(
{
type: 'post',
url: '/Home/Shopcar_save',
data: 'type=save',
success: function (data) {
alert('Your data have been saved!');
alert(data);
},
error: function (data) {
alert('Your data have been errored!');
}
});
}
});
controlled:
[HttpPost]
public void Shopcar_save(String type)
{
Response.Write("成功");
}
老是error!!!是什么问题! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询