0

I am wondering if it is possible to have my program which ends with a page refresh, automatically run again after the page refreshes.

2 Answers 2

1

call the function(s) you want to run.

function doBusiness() {
  // the business
}
doBusiness(); // leave the program where it is but make sure this is outside of any function that isn't called right away

If you don't want to do business the first time the page loads, look into sessionStorage, good starting point is mozilla doc. cheers

Sign up to request clarification or add additional context in comments.

Comments

1

You can use:

<body onload="yourLoadingFunction()">

or

document.onload = function(){
   //your code here
}

Any of these functions should be included in your tag in your page.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.