문제

I am currently trying to open tabs in chunks with a loop and a recursive call of a function:

open_pix : function()
{
    ...

    for (i=start; i <= rounds; i++) 
    {
        window.open(mp_op.xpathResult.snapshotItem(i).getElementsByTagName("a")[0].href,'');
    }

    ...

    if (flag)
    {
        var t = window.setTimeout( mp_op.open_pix, mp_op.timeoutMS );
    }

Unfortunately my script stops working completely after it has opened the first chunk of tabs. I assume that the script is killed after the browser loaded new tabs, but this can't be right because it would have stopped after the first opened tab.

So what did I do wrong again ?

올바른 솔루션이 없습니다

다른 팁

do it in this way

   open_pix : function()
    {
        ...
        opner : function () {
           for (i=start; i <= rounds; i++) 
          {
            window.open(mp_op.xpathResult.snapshotItem(i).getElementsByTagName("a")[0].href,'');
          }

           ...

           if (flag)
           {
             var t = window.setTimeout( mp_op.open_pix, mp_op.timeoutMS );
           }
         }
      opner();
    }

so after the open_pix finish exacting the opner function keep work "closures"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top