onload and move to a point down the page

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

    onload and move to a point down the page

    I am looking for a way to open a given html page where I want, and not
    at the top of the page.

    This is for an intranet, not the www. I use a core application which
    takes templates containing FoxPro function calls and creates html pages
    which are then sent to the browser. As a result, I am unable to modify
    the url to simply attach the target id to the url to enable the browser
    to open the page at the point I want.

    So, is there something that I can put in the onload attribute of the
    <body> tag which would direct the browser down to the point I want (ie
    by id value of a div)? In other words, do the equivalent of
    "www.someurl.co m/page.html#somei d"?

    Thank you.
    --
    Christine

  • DU

    #2
    Re: onload and move to a point down the page

    Christine Forber wrote:[color=blue]
    > I am looking for a way to open a given html page where I want, and not
    > at the top of the page.
    >
    > This is for an intranet, not the www. I use a core application which
    > takes templates containing FoxPro function calls and creates html pages
    > which are then sent to the browser. As a result, I am unable to modify
    > the url to simply attach the target id to the url to enable the browser
    > to open the page at the point I want.
    >
    > So, is there something that I can put in the onload attribute of the
    > <body> tag which would direct the browser down to the point I want (ie
    > by id value of a div)? In other words, do the equivalent of
    > "www.someurl.co m/page.html#somei d"?
    >
    > Thank you.[/color]

    <head>
    (...) usual declarations (...)
    <script type="text/javascript">
    function init()
    {
    if(document.get ElementById &&
    document.getEle mentById("somei d").scrollIntoV iew)
    {
    document.getEle mentById("somei d").scrollIntoV iew(true);
    };
    // will work in MSIE 5+ and Mozilla-based browsers. Not in Opera.
    }
    </script>
    </head>

    <body onload="init(); " ...>

    DU
    --
    Javascript and Browser bugs:

    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x


    Comment

    Working...