samedi 3 février 2018

make a redirect button in html with javascript

Here is the code I am attempting to use and embed in a Google Sites page:

<!DOCTYPE html>
<html lang="en-US">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Please follow the link below</title>
    <script>
    var urls = [
        "http://www.kittenwar.com/",
        'http://heeeeeeeey.com/',
        'http://eelslap.com/',
        'http://www.staggeringbeauty.com/',
        'http://www.omfgdogs.com/',
        'http://burymewithmymoney.com/',
        'http://www.fallingfalling.com/',
        'http://ducksarethebest.com/',
        'http://www.republiquedesmangues.fr/',
        'http://www.trypap.com/',
    ];

    function goSomewhere() {
        var url = urls[Math.floor(Math.random()*urls.length)];
        window.location = url; // redirect
    }
</script>
</head>

<body>

</body>



</html>

How do I make this work so that a button will appear in my Google Sites page that will randomly assign you to one of the listed array of links?




Aucun commentaire:

Enregistrer un commentaire