(asp.net mvc)后台函数请求到了,但在error中alert了,ajax请求失败.求高手解决、
<scripttype="text/javascript"language="javascript">functionsummit(){inputxt=$("input"...
<script type="text/javascript" language="javascript">
function summit() {
inputxt = $("input").val();
$.ajax({
url: '/HJxiaoD/GetQueryResult',
contentType: "application/json",
type: 'post',
data: 'content=' + inputxt,
dataType: 'json',
async: true, //异步
cache: false, //不加载缓存
success: function(data) {
alert(data);
},
error: function(data) {
alert(data);
}
});
//return false;
}
</script> 展开
function summit() {
inputxt = $("input").val();
$.ajax({
url: '/HJxiaoD/GetQueryResult',
contentType: "application/json",
type: 'post',
data: 'content=' + inputxt,
dataType: 'json',
async: true, //异步
cache: false, //不加载缓存
success: function(data) {
alert(data);
},
error: function(data) {
alert(data);
}
});
//return false;
}
</script> 展开
2个回答
展开全部
<script type="text/javascript" language="javascript">
function summit() {
inputxt = $("input").val();
$.ajax({
url: '/HJxiaoD/GetQueryResult',
contentType: "application/json",
type: 'post',
data: 'content=' + inputxt,
dataType: 'json',
async: true, //异步
cache: false, //不加载缓存
success: function(dt) {
alert(dt);
},
error: function(dt) {
alert(dt);
}
});
//return false;
}
</script>
function summit() {
inputxt = $("input").val();
$.ajax({
url: '/HJxiaoD/GetQueryResult',
contentType: "application/json",
type: 'post',
data: 'content=' + inputxt,
dataType: 'json',
async: true, //异步
cache: false, //不加载缓存
success: function(dt) {
alert(dt);
},
error: function(dt) {
alert(dt);
}
});
//return false;
}
</script>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询