$.ajax请求返回数据中status为200,回调的却是error

代码无错误,但是一直没有正确获取到数据,查看了chrome浏览器控制台发现status=200,readystate=4,却调用的是error函数。

1.被调用的 action:

public string UpdateLowPrice(string contentid, string lowPrice, string modeltype)
{
	//....程式
	return "xxx";
}

这个方法返回的是单纯的字符串!

2.调用者的ajax:

 $.ajax({
		type: "post",
		url: "http://uusp.liontravel.com/updateLog/UpdateLowPrice",
		data: { contentid: '2804', lowPrice: "4378", modeltype: "I07" },
		//dataType: 'json', //请求返回的data中status为200,但是回调的方法是error,将dataType类型改为“text”后,便不会出现这个问题
		dataType: 'text', //将dataType类型改为“text”后,便不会出现这个问题
		success: function (data) {
					alert("成功啦!");
				},
		error: function (data) {
					alert("失敗啦!");
				},
		});

你可能感兴趣的:($.ajax请求返回数据中status为200,回调的却是error)