onload and move to a point down the page

C

Christine Forber

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.com/page.html#someid"?

Thank you.
 
D

DU

Christine said:
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.com/page.html#someid"?

Thank you.

<head>
(...) usual declarations (...)
<script type="text/javascript">
function init()
{
if(document.getElementById &&
document.getElementById("someid").scrollIntoView)
{
document.getElementById("someid").scrollIntoView(true);
};
// will work in MSIE 5+ and Mozilla-based browsers. Not in Opera.
}
</script>
</head>

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

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 

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,090
Messages
2,570,603
Members
47,223
Latest member
smithjens316

Latest Threads

Top