Jump to content

Executar function de x em x segundos


KiNgPiTo
 Share

Recommended Posts

Boa tarde!

A dúvida é a seguinte ( a utilização vai ser mais complexa mas o principio é o mesmo e mais fácil de explicar assim  😉 ):

Como é que posso ter uma função que apresenta um alert de por exemplo 10 em 10 segundos?

Muito obrigado

Lol, encontrei a resposta a isto... Fica aqui para quem precisar:

<script language="javascript">

function funcao(){

alert("teste");

}

window.setInterval('funcao()', 2000);

</script>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.