Click to See Complete Forum and Search --> : how to invoke an anchor in onload
webrunner
03-05-2003, 03:21 PM
I want to jump to an anchor in the body onload attribute. so I tried to change the location to the anchor. parent.window.bsscright.location.href="anchor" or window.location.href="anchor" should work. So far it does not seem to work. So i am at a loss. Probably you just can't do it this way. Yes I know I can use change focus but that doesn't quite work the way I want it to. Right now I haven an accesskey and links that jump to the desired anchor.
Does this work:
parent.window.bsscright.location.href=document.location+"#anchorname";
webrunner
03-05-2003, 03:46 PM
It doesn't appear to work when I try it. It should be jumping to the anchor but if it does it is for one reason or anything jumping somewhere else. My accesskeys work well so i don't know what is wrong. I am doing this mainly to help screen readers to find the desired page invoked but right now it seems to go where it wants. I came out with the anchor idea because it seems when you use anchors that the virtual cursor jumps to the appropriate place.
Try this instead once...
parent.window.bsscright.location.href=parent.window.bsscright.location+"#anchorname";