NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Mike Grigsby on May 02, 2008, 09:40:08 PM
-
I'm thinking the answer is "no", but it might be a useful enhancement. Is there a way to add code to the body tag globally so I don't have to do it in every procedure?
What I want to do is add timeout code to my pages so a warning appears before the session timeout. For example;
<body onload="setTimeout('TimeoutWarning()', 900000)">
Maybe a procedure similar to PageFooterTag/PageHeaderTag that could define various parts of the page and cause them to inherit the code.
-
Hi Mike,
Actually there is a way to do what you want (specifically) but since that's the wrong thing to do in this case, I'm not gonna tell you :). ( Well, ok, it involves overriding the _jsBodyOnLoad method in the web handler.)
However what you are doing is equivalent to putting the following inside the body somewhere;
<script>setTimeout('TimeoutWarning()', 900000);</script>
And since you want that on every page, then it seems to make sense to put it into the header, or footer procedure.
Cheers
Bruce