使用js实现随机跳转到一个网址

/*
source:http://blog.junsangs.com
author:花海
*/
<!-- 随机跳转-->
    <script>
    function jumpUrl() {
    var arr = new Array(
    "链接1",
    "链接2",
    "自行添加链接",
    );

    window.location.href = arr[Math.floor(Math.random() * arr.length)];
    }

    setTimeout(function () {
    jumpUrl();},6000);//设定跳转时间,1s=1000
    </script>
JavaScript

TAG


— THE END —