woensdag, november 30, 2005

Javascript helps you, to go to an anchor on your webpage

This function (VB. NET) uses javascript to navigate to a specific anchor on your webpage,
This function is only for navigating to #convert, but you can easy change the function offcourse:



If anybody knows how this is possible in ASP.NET, let me know, I'm not a freak yet

1 opmerking:

Anoniem zei

You can also use

window.location.hash="anchor";

for instance

function callAnchor(){
window.location.hash="anchor";}

<a name="anchor">

text text text text text
text text text text text
text ... ... ..
... ... ...
... ... ...
text text text text text
text text text text

<p onclick="callAnchor();">Link</p>

Also it's possible in this way [the short way]

<p onclick="window.location.hash=anchor'">Link</p>