Alrighty, a quick JSP tidbit relevant to what I'm trying to do.
The Code in my last post I am planning on putting in a seperate jsp page.
Then in any page I want to use the scroll value stuff in I'll go
<%@ include="DoScroll.jsp" %>
what that does can be thought of as a copy paste. When the jsp is compiled it'll go have a look at the DoScroll.jsp and dump it's contents whereever the include directive is.
Or to put it another way, I can put the code in a file called DoScroll.jsp and use the include directive, or I can copy paste the whole section of code at the top of any jsp I want to use it in. The results will be the same.
So at the top of my page I'll have
it will be followed by either
or nothing depending on whether request.getParameter("Scroll_Value" == null)
onload = function()
window.scrollTo(0,<%= request.getParameter("Scroll_Value") %> );
and then the passScrollValue function
Does that look right to you?
var scrollValue = (typeof document.getElementsByTagName('body') != 'undefined') ?
(typeof window.PageYOffset != 'undefined') ?
var Scroll_Value = document.createElement(Scroll_Value);
The reason I don't want to hard code the form is I want to be able to use the code in different pages without changing it.
I'm also curious as to why you are returning true from the function. It can only ever return true so why bother?