ajax判断后端返回的数据是否为null的方法
1、后端返回:
return null;
2、ajax需要判断:
if(null != jsonStr && "" != jsonStr){具体代码:
$.ajax(
{
type: "POST",
data: {
name: name,
code: code
},
dataType: "json",
url: "info",
success: function(jsonStr) {
if(null != jsonStr && "" != jsonStr){
$("#curator_info").html("ok");
} else {
$("#curator_info").html("no");
}
}
}
); 相关推荐
yangkang 2020-11-09
lbyd0 2020-11-17
KANSYOUKYOU 2020-11-16
wushengyong 2020-10-28
腾讯soso团队 2020-11-06
Apsaravod 2020-11-05
PeterChangyb 2020-11-05
gyunwh 2020-11-02