Click to See Complete Forum and Search --> : Problem: How to follow a link..


Kain
03-06-2003, 10:56 AM
My question is wether someone can tell me how I can follw a link (like <A href...> ) by a Javaskript statement.
I got the node allready it's something like
frame[0].document.getElementsByTag("a")[0].
so I'm looking for the statement after the dot, so the link will be executed - like the .click() on Buttons, or the submit() on forms, just for links.

Regards
Kain

skriptor
03-07-2003, 01:40 AM
Hi,
try something like this:
No way back:
self.location.replace( frame[0].document.getElementsByTagName("a")[0].href );

or back possible:
self.location.href = frame[0].document.getElementsByTagName("a")[0].href ;

Good luck, skriptor.

AdamBrill
03-07-2003, 07:34 AM
Actually, you can use .click() on a link. Like this:

frame[0].document.getElementsByTag("a")[0].click();

So, you could just do it that way, too. I hope that helps...