Start page at different locations?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Harry

    #1

    Start page at different locations?

    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( "startatlin k" );

    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


  • Kevin Thorpe

    #2
    Re: Start page at different locations?

    Harry wrote:[color=blue]
    > 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( "startatlin k" );
    >
    > 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
    >
    >[/color]
    No need for js at all.

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

    Comment

    • Harry

      #3
      Re: Start page at different locations?

      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( "startatlin k" );
      if(startAtLink! =null)
      {
      %>
      window.location = '#<%= startAtLink %>';
      <%
      }
      %>

      seems to work well - thanks anyway!

      "Kevin Thorpe" <kevin@pricetra k.com> wrote in message
      news:3f055eee$0 $13010$afc38c87 @news.easynet.c o.uk...[color=blue]
      > Harry wrote:[color=green]
      > > I would like to be able to set the start location of a page each time[/color][/color]
      its[color=blue][color=green]
      > > displayed depending on the value of a request object -i.e
      > >
      > > // Called from <body> onload attribute
      > > function load()
      > > {
      > > <%
      > > String startAtLink = (String)request .getAttribute( "startatlin k" );
      > >
      > > if(startAtLink! =null)
      > > {
      > > %>
      > > // jump to location of startAtLink link e.g Step3 defined as[/color][/color]
      <a[color=blue][color=green]
      > > name="Step3"></a> futher on down
      > > // may also have Step4, Step5 etc...
      > > <%
      > > }
      > > %>
      > >
      > > thanks
      > >
      > > harry
      > >
      > >[/color]
      > No need for js at all.
      >
      > http://www.site.com/mypage.html#Step3
      >[/color]


      Comment

      Working...