Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8392035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:24:56+00:00 2026-06-09T19:24:56+00:00

I have this javascript method that needs to run in the background window.setInterval(function(){ validateCaseStatus();

  • 0

I have this javascript method that needs to run in the background

window.setInterval(function(){
 validateCaseStatus();
}, 3000);        

On the same page I have a button that asks the user if he wants to submit uploaded documents. But I noticed when the popUp msg(alert) is up the script on the page wont run.

Is there a way to keep the script running?

I use this method to check if the case status is changed and disable window.onbeforeunload.
My question is if theres a way I can keep the script above running even when a popUp alert is shown.

//cancels onbefore close popup when docs are submitted
function validateCaseStatus(){

     caseStatus = sforce.apex.execute("IFAP_WebService","CheckCaseStatus", {!$caseId});  

    if (caseStatus == "Uploaded" || caseStatus == "Submitted")
    {
         submitted = true; 
        window.onbeforeunload  = null;
        validateCaseStatus = null;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T19:24:57+00:00Added an answer on June 9, 2026 at 7:24 pm

    Try using WebWorkers. It’s a new html5 concept, and requires a bit more work, but they are very easy to understand and very helpful. See https://developer.mozilla.org/en-US/docs/DOM/Using_web_workers?redirectlocale=en-US&redirectslug=Using_web_workers http://ejohn.org/blog/web-workers/ and http://www.html5rocks.com/en/tutorials/workers/basics/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem when call applet method from javascript.. I used this function
I have this Javascript function that sends username and password to php file through
I have a javascript method looks like this JSMethod(JS_para_1,JS_para_2) { ...... ,,,,, } and
I have a relatively simple HTML / JavaScript form. Such as this: <form method='POST'
I have this Javascript: <script language=javascript type=text/javascript> $().ready(function() { $('#ex2').jqm({ajax: 'view.php?id=<?=$objResult[id];?>', trigger: 'a.ex2trigger'}); });
I have this javascript code below that uses jquery, it is suppoed to be
I have a form that needs to run a php script once the submit
I have a need for a simple html + javascript page that must send
I have written an external script that needs to run after DOM is ready
I have a flex application that needs the ability to generate and execute JavaScript.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.