How to check if ajax return exist?
This question already has an answer here:
You can try the following:
$.ajax({
url: 'DBConnector.php',
type: 'GET',
dataType: 'json',
success: function(data)
{
if(data.status !== undefined)
{
//YOUR CODE HERE
}
}
});
It will check if the status
exists or not.
上一篇: 检查javascript对象中的键
下一篇: 如何检查ajax是否存在?