0
function test() {
    some_code;
}

function do_many_test() {
    var i;
    for(i=0;i<100;i++){
        test();
    }
    some_code;
    some_code;
    some_code;
}

The function do_many_test() makes browser stuck for about ten seconds: is there a way to call it making it running in background while the execution flow continues to next code?

SctALE
  • 509
  • 2
  • 10
  • 30
  • something called ajax maybe.. also look here http://stackoverflow.com/questions/9516900/how-can-i-create-an-asynchronous-function-on-javascript – lordkain Nov 24 '15 at 10:24

1 Answers1

0

If you are using modern browser. you can use webworker https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers

Sandeeproop
  • 1,756
  • 1
  • 12
  • 18