If it is current, will it occurs the problem of call stack overflow?
because it call self infinite recursively
If it will occurs such problem, are there any better implementation?
function waitForMsg(){ $.ajax({ type: "GET", url: "xxx.php", async: true, cache: false, timeout: 600000, success: function(data){ handleFunction(data); waitForMsg(); }, error: function(XMLHttpRequest, textStatus, errorThrown){ XMLHttpRequest.abort(); waitForMsg(); } }); }