mtomko
05-11-2007, 05:32 AM
I need to automatically redirect the browser to a page specified by a link on the current page.
I need to feed the value of either a
<div id="myID">mylink</div>
or the value in an anchor
<a href="mylink">
to the function
redirectTo(){
elem = document.getElementById("mylink").text;
window.location = elem;
}
which is later used in
<body onLoad="setTimeout('redirectTo()', 1)">
BUt it doesn't work...
I tried
getElementById("mylink").value
text
anchor.href
nothing works. Where is my problem?
thanks
M.
I need to feed the value of either a
<div id="myID">mylink</div>
or the value in an anchor
<a href="mylink">
to the function
redirectTo(){
elem = document.getElementById("mylink").text;
window.location = elem;
}
which is later used in
<body onLoad="setTimeout('redirectTo()', 1)">
BUt it doesn't work...
I tried
getElementById("mylink").value
text
anchor.href
nothing works. Where is my problem?
thanks
M.