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

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top