Start page at different locations?

H

Harry

I would like to be able to set the start location of a page each time its
displayed depending on the value of a request object -i.e

// Called from <body> onload attribute
function load()
{
<%
String startAtLink = (String)request.getAttribute( "startatlink" );

if(startAtLink!=null)
{
%>
// jump to location of startAtLink link e.g Step3 defined as <a
name="Step3"></a> futher on down
// may also have Step4, Step5 etc...
<%
}
%>

thanks

harry
 
K

Kevin Thorpe

Harry said:
I would like to be able to set the start location of a page each time its
displayed depending on the value of a request object -i.e

// Called from <body> onload attribute
function load()
{
<%
String startAtLink = (String)request.getAttribute( "startatlink" );

if(startAtLink!=null)
{
%>
// jump to location of startAtLink link e.g Step3 defined as <a
name="Step3"></a> futher on down
// may also have Step4, Step5 etc...
<%
}
%>

thanks

harry
No need for js at all.

http://www.site.com/mypage.html#Step3
 
H

Harry

Trouble is, I'm using struts & forwarding to jsp pages with # on the end is
a bit tricky if at all possible - got around it now using

<%
String startAtLink = (String)request.getAttribute( "startatlink" );
if(startAtLink!=null)
{
%>
window.location = '#<%= startAtLink %>';
<%
}
%>

seems to work well - thanks anyway!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top