How to set href of <a> in another frame?

D

Dr Joolz

Dear all, I have in the left frame some javascript that sets a href of an
<a> in the right frame.

left:

parent.right.document.getElementById("openNew").setAttribute("href",
svgDir+svg[index]+"_1.svg");

, where svgDir and svg[] are both valid and working in other javascript code
that also manipulates stuff in the right frame. but for some odd reason this
doesn't work for href...

right:

<a id="openNew" href="20031006.svg" target="_new">Open in new window</a>

I've also tried:

parent.right.document.getElementById("openNew").href =
svgDir+svg[index]+"_1.svg";
parent.right.document.links[0].href = svgDir+svg[index]+"_1.svg";
parent.right.document.anchors[0].href = svgDir+svg[index]+"_1.svg";

The <a> is the first anchor in the right html and I just can't work out why
it's not working... please help...

Thanks, Julius
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top