xmlhttprequest - Javascript - Synchronous http request -


i need make synchronous request server continue script processing.

as xmlhttprequest shouldn't synchronous, , it's not way use "while" until end of request, might :

function main(continue) {    if (continue == undefined) {      server_call();    }    else {      /* ok, here i'm sure http request done */    }  }    var tmp_bool;  function server_call() {    var tmp_bool = false;    http_request_function() {      /* here when request done */      var tmp_bool = true;    }    wait_until_function();  }    function wait_until_function() {    if (tmp_bool)      main(true);    else      window.settimeout("wait_until_function();", 1000);  }

it's not clean, should work. isn't there way subscribe event or of kind ?

regards.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -