By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,287 Members | 1,582 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,287 IT Pros & Developers. It's quick & easy.

Start page at different locations?

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Harry wrote:
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

Jul 20 '05 #2

P: n/a
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!

"Kevin Thorpe" <ke***@pricetrak.com> wrote in message
news:3f***********************@news.easynet.co.uk. ..
Harry wrote:
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

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.