如何在边缘脚本完成后将用户定向到新页面

How to direct user to new page after edge script completes

本文关键字:用户 新页面 边缘 脚本      更新时间:2023-09-26

当用户转到此页面时,我正在运行 adobe 边缘动画脚本,我希望该页面在边缘脚本完成后自动将用户重定向到新页面(第一个.html)。如果我使用 window.location.href,无论我把它放在哪里,当页面加载时,边缘脚本都不会运行,它只是将我定向到新页面。我应该使用其他功能吗?设置超时也许?也不能让它工作。

    <script type="text/javascript" charset="utf-8" src="index_edgePreload.js"></script>
    <style>
    .edgeLoad-EDGE-132380638 { visibility: hidden; }
    </style>
    <!--Adobe Edge Runtime End-->
    </head>
    <body style="margin:0;padding:0;">
    <div id="Stage" class="EDGE-132380638"> </div>
    </body>
    <script>window.location.href = "first.html";
        </script>
    </html>

setTimeout工作:

    <script>
    setTimeout(function(){
        window.location.href = "first.html";
    }, 4000);
        </script>