Advanced HTML Component – Page Redirect

In our first post covering the Advanced HTML Component, one of the examples we gave was for a delayed page redirect. Seeing as that example is now four years old and we get requests for this feature regularly, we thought we’d provide an update.

The example below should be pasted into an Advanced HTML Component. The wa/page?oid=146 and 5000 need to be changed to your own page URL and delay. You can get the URL for the target page by right-clicking the page name in the project site map and choosing get URL.

This redirect will only work in Run and Share -> Open in Review modes.

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
    var targetPage = "/wa/page?oid=146"; // Target page URL
    var delay = 5000; // Delay before redirect in milliseconds
    function redirect(){
        var frame = window.parent.frameElement ? window.parent.frameElement : window.frameElement;
        if (!frame.s9_workspace) {
            setTimeout(function() { window.parent.location = targetPage; }, delay);
        }
    }
</script>
<title></title>
</head>
<body onLoad="redirect()" style="background:transparent;">
</body>
</html>

 

This entry was posted in Blog, ProtoShare Tips & Tricks. Bookmark the permalink.

Previous post:
Next post:

Leave a Reply

Your email address will not be published. Required fields are marked *