title: JavaScript causing "A script on this page may be busy, or it may have stopped responding." error in Firefox
body: <p>I wrote a page by javascript that has over 1000 lines of code and so the page is so heavy.
  when i run the page on the firefox, it tell me that:</p>
  
  <pre><code>A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
  
  Script: http://localhost:5070/resources/ir.pnusn.branch.ui.pages.BranchMap/scripts/MapAddress.js:151
  </code></pre>
  
  <p>and I have in MyAddress.js:151:</p>
  
  <pre><code>function fillAddress(number)
  {
  150:    var filedNum=0;
  151:    while(document.getElementById("choice4")!=null)
          document.getElementById("choice4").click();
      nextId=1;
      for(i=0;;i++)
      {
          var cookieChoiceName=number+"-"+filedNum+"-0";
          var cookieChoiceValue=getCookie(cookieChoiceName);
          if(cookieChoiceValue==null)
          {
              //alert(document.getElementById("choice4"));
              break;
          }
          var cookieFieldName=number+"-"+filedNum+"-1";
          var cookieFieldValue=getCookie(cookieFieldName);
          if(cookieFieldValue==null)
          {
              alert(document.getElementById("choice4"));
              break;
          }
          if(cookieChoiceValue!= "-1" &amp;&amp; cookieChoiceValue!="-2" &amp;&amp; document.getElementById("choice"+cookieChoiceValue)!=null)
          {
              document.getElementById("choice"+cookieChoiceValue).click();
          }
          var value=utf8_decode(unescape(cookieFieldValue));
          var finalval=replacePluse(value);
          // var Resvalue=value.substr(1,value.length-1);
          document.getElementById("txt"+(filedNum-1)).value=finalval;
          filedNum++;
      }
  }
  </code></pre>
  
  <p>and when I press continue in warning window the code work correctly.
  but when i increase dom.max_script_run_time in firefox configuration file it does not change
  and after that when I press continue again it works.
  What's the problem?If you want more information about the code tell me to put for you here.</p>