Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OnLoad jump to named anchor

Status
Not open for further replies.

Sarahz

Technical User
Jun 26, 2002
10
US
Hello all,

On the OnLoad event, I need a page to jump to a named anchor without reloading the page. I'm not having any luck with the following code:

Code:
<body onLoad=javascript:window.location.hash='#storeloc1'&quot;>

<a name=&quot;storeloc1&quot;>Jump to this anchor</a>

Can someone please tell me what I'm doing wrong and how I might get this to work --- thanks!!!

Sarah
 
try this:
Code:
<body onLoad=javascript:window.location = '#storeloc1'&quot;>

-pete

 
sorry,
Code:
<body onLoad=&quot;javascript:window.location = '#storeloc1'&quot;>
-pete

 
Hey Pete,

Thanks for answering so quickly! Sadly, your suggestion isn't working for me either.

Sarah
 
shoot, my bad, not with it today [hammer]

Code:
<body onLoad=&quot;window.location = '#storeloc1'&quot;>

-pete

 
Thanks Pete - that worked perfectly!

Sarah
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top