title: Stop/Resume jquery function
body: <p>I have alert/confirm boxes in a function and then I use custom alert boxes instead of the system's alert/ confirm boxes.
  I want the same functionality as the system's alert/confirm boxes have.
  Like once I show my custom alert popup it stops the function in which I call that popup and when I click Ok after confirmation it resumes that function again.</p>
  <p>Also, I have multiple alerts and confirm boxes in a single function, So I want them to run in a proper manner in which the system's alert boxes run.</p>
  <p>function startUp(){</p>
  <pre><code>if (errors != &quot;&quot;)
  { 
      alert(&quot;$errors&quot;);
  }
  
  
      if (confirm(&quot;$warning&quot;))
      {
          document.modifyForm.submit();
      }
     
  </code></pre>
  <p>}</p>
  <p>In this above example, I have 1 alert and 1 confirm box
  by default when the alert came to the system stops the code's execution and then click OK or cancel then code resume</p>
  <p>I want the same by using custom popup
  When I put my popup instead of the alert box it does not stops the code. So, I want to stop the code and when I click OK or Cancel on my custom popup then code resume and it goes to confirm box after alert finished and then confirm box do the same.</p>