M
M
Michael2015-07-24 16:56:40
Google
Michael, 2015-07-24 16:56:40

Chrome console is misleading Maximum call stack size exceeded?

There is a function like

$(document).ready(function(){
        test_call();
    });
    function test_call(){
        setTimeout(function(){
        $.post(
            "ajax/time_test.php",
            function (data) {
                console.log(data);
                if(data=='close'){
                    location="exit.php";
                }
                else{
                    test_call();
                }
            }
        );
    },60000);}


The point is that when you open the page with the code, everything opens normally, but when you reload the page with the console open, a number of
Uncaught RangeError: Maximum call stack size exceeded errors occur,
and everything related to jquery is not immediately loaded.
If you do not open the console, everything works fine.
The question itself is, is this a console problem or is there something wrong with my code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2015-07-24
@mix_gorbachev

$(document).ready(function(){
  test_call();
});
function process_response(data) {
  console.log(data);
  if(data == 'close'){
    location = "exit.php";
  }
  else{
    test_call();
  }
}
function test_call(){
  setTimeout(function(){
    $.post("ajax/time_test.php", process_response );
  },60000);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question