I call the getResult()
function everytime when res.reply = 2
, but there are cases that res
is empty. When the returned value is empty console.log("error")
is invoked. This works in older versions of jQuery Mobile. Now the version is 1.3.2.
function getResult()
{
request = $.ajax({
type: "POST",
url: url,
dataType: "json",
data: {
....
},
error: function() {
console.log("error");
},
success: function(res) {
if(res.reply=='2') {
getResult();
}
}
});
}