Link to home
Start Free TrialLog in
Avatar of robrodp
robrodpFlag for Mexico

asked on

automatic button click script

I have this code

<script>
function refresh()  
{
    window.location.reload();
}
</script>
<button onclick='refresh();'>Refresh the page once</button>

I need a script that will reload without having to click on the button
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Without Javascript :
http://www.metatags.info/meta_http_equiv_refresh
http://www.w3.org/TR/WCAG-TECHS/H76.html

with javascript :
<script>
     setInterval(function() { window.location.reload(); }, 2000); // every 2s
</script>

Open in new window

Avatar of robrodp

ASKER

I want it to reload once so the page refreshes and the form can be used
Use setTimeout instead setInterval
Avatar of robrodp

ASKER

how?
Check my code, read my previous answer...
Avatar of robrodp

ASKER

what is the difference?
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial