Visualizzazione dei risultati da 1 a 3 su 3

Discussione: js: redirect

  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2001
    Messaggi
    274

    js: redirect

    Salve,
    qualcuno sa consigliarmi un js che dopo N secondi dal caricamento di una pagina, redirecta il browser su un'altra?

    grazie!
    Progeny

  2. #2
    Utente di HTML.it L'avatar di Igor70
    Registrato dal
    Aug 2002
    Messaggi
    131
    <html>
    <head>
    <SCRIPT>
    var interval = "";
    var i = 5;
    function startInterval()
    {
    interval = window.setInterval("tTimer()",1000);
    }
    function stopInterval()
    {
    window.clearInterval (interval);
    interval="";
    }
    function tTimer()
    {
    document.f.display.value = i--;
    if (i == -1)
    {
    stopInterval();
    alert ("TIME'S UP");
    }
    }
    </SCRIPT>
    </head>
    <body>
    <form name=f>
    <input type=text name=display value="">
    </form>
    <script>
    startInterval();
    </script>
    </body>
    </html>

    Basta che aggiungi window.location.href("tuoURL")

  3. #3
    Utente di HTML.it
    Registrato dal
    Nov 2001
    Messaggi
    274
    grazie
    Progeny

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.