I have a page that displays after a user submits input. After the page displays, I'd like to redirect to a home page after 5 seconds. The trick is that I need to maintain the session state. I've figured everything out except how to get the URL into the timeout call. Can someone point me in the right direction?
I have an item: P3_URL that is being set by a BEFORE HEADER computation:
select 'http://192.168.168.201:7777/pls/htmldb/f?p=113:4:'||&APP_SESSION.||':::::' from dual
My HTML header is as follows:
<script type="text/javascript">
redirectTime = "5000";
redirectURL = document.getElementById("P4_URL").value;
function timedRedirect() {
setTimeout("location.href = redirectURL;",redirectTime);
}
addLoadEvent(function(){timedRedirect();});
</script>
I've verified that the URL is populating correctly as a hidden page item, and the timeout works if I substitute with an Alert box. If I hard-code the URL it also works. This should be an easy thing, but I'm not great at JavaScript.