Javascript: want Refresh every 15 minutes to submit function

I want every 15 minutes to have the Javascript Refresh to submit a JavaScript function in my page.

How do I do this? I forget the syntax for the refresh and don't know how to have it submit a function.

Thank you,
BILL CarlisleAPEX DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hello bcarlis,

You can use the following code

<script type="text/JavaScript">
function timedRefresh(timeoutPeriod) {
//   -->

This page will refresh every 5 seconds. This is because we're using the 'onload' event to call our function. We are passing in the value '5000', which equals 5 seconds.


erikTsomikSystem Architect, CF programmer Commented:
simply add meta tag inside the <head tag

CONTENT= means that the page  will be refreshed in number specified
BILL CarlisleAPEX DeveloperAuthor Commented:
Thanks for the quick responses!

So the onload calls timedRefresh(lets say 45min)
so if the screen is sitting idle for 45min it will refresh...

that's not what I want. I realize that I maybe shouldn't of used the word "refresh"

What I want is if the screen is sitting idle for 45min, someone is looking things up, entering information into t it will submit my javascript function which will save the data and the screen will be directed to another page.


Michel PlungjanIT ExpertCommented:
Something like

<script type="text/javascript">
var mins = 45;
var timeout = mins*60*60*1000;
function submitIt() {
var tId="";
function timeIt() {
window.onmousemove=window.onload=function() {
<form action="saveStuff">
<textarea name="stuff"></textarea>
<input type="submit" value="save">

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.