Changing 2 frames with Javascript

Changing 2 frames with Javascript

Posted by: d_and_k
Posted on: 2005-08-23 12:18:00

I used this code from a tutorial to change two frames at once, and it worked fine for the first two links, then I used it on all the other links and it wont open anything exept the last link on the list. The url is http://www.darkerkind.com feel free to view source and get back to me. Thanks in advance for your help!

I have a feeling it might be as simple as putting a name on the seperate scripts. But I dont know.Edited by d_and_k on 08/23/05 12:24 PM (server time).

Re: Changing 2 frames with Javascript

Posted by: decswxaqz
Posted on: 2005-08-24 01:20:00

Numerous errors are thrown up using firefox.

In reply to:

<A HREF="#" onclick="change2('r1.html',rfrev.html')">~:Reviews:~</A>


Should be changed to

In reply to:

<A HREF="#" onclick="change2('r1.html','rfrev.html')">~:Reviews:~</A>


(missing ' next to rfrev.html)

You also have too many functions called the same thing. I don't think JS supports function overloading but I could be wrong...

Try removing all of the functions (keep a backup somewhere) and replacing them with

In reply to:

<SCRIPT type="text/JavaScript">
function change2(middle_link, right_link){
parent.middle.location = middle_link;
parent.right.location = right_link;
}
</SCRIPT>



Also, you've called your CSS file "mystyle2.css.html", rename the file "mystyle2.css" and make sure you change the link in your HTML, make those changes and I'll try to help with any others that popup :P.

Tags: framesview sourceseperatedont knowscriptsjavascripturlhelphttp