2 frames anf javascript

Hello,

I have 2 frames and the following javaScript (animated buttons). The left frames has the animated buttons (alway the same frame) and should call the right frames.  When I click on the buttons (left) it loads the page unto the left frame unstead of the right ??

here is the script THANKS!:


<SCRIPT language="JavaScript">
<!--
var bn=navigator.appName;
var vn=navigator.appVersion;
var p1=null;
var p2=null;
var p3=null;
var p4=null;
var p5=null;
// Animated menu stuff
function off_img(loc,img) {};
function on_img(loc,img) {};

function gonow(p)
  {
  location=addr[p];
  };

var addr = new Array(5);
addr[1]="prokiad-intro.html";
addr[2]="selnas-index.html";
addr[3]="presse-index.html";
addr[4]="anglais-index.html";
addr[5]="commande-index.html";
menuimg = new Array(10);
if ((bn!="Microsoft Internet Explorer") || (vn.substring(0,3)!="2.0"))
{
menuimg[1]= new Image (90,53);
menuimg[1].src="prokiad-j-black.jpg";
menuimg[6]= new Image (90,53);
menuimg[6].src="prokiad-v-black.jpg";
menuimg[2]= new Image (90,53);
menuimg[2].src="méthode-j-black.jpg";
menuimg[7]= new Image (90,53);
menuimg[7].src="méthode-v-black.jpg";
menuimg[3]= new Image (90,53);
menuimg[3].src="presse-j-black.jpg";
menuimg[8]= new Image (90,53);
menuimg[8].src="presse-v-black.jpg";
menuimg[4]= new Image (90,53);
menuimg[4].src="anglais-j-black.jpg";
menuimg[9]= new Image (90,53);
menuimg[9].src="anglais-v-black.jpg";
menuimg[5]= new Image (90,53);
menuimg[5].src="commande-j-black.jpg";
menuimg[10]= new Image (90,53);
menuimg[10].src="commande-v-black.jpg";
}

function on_img(loc,img)
  {
  if ((bn!="Microsoft Internet Explorer") || (vn.substring(0,3)!="2.0"))
    loc.src=menuimg[img].src;
  }

// -->
</SCRIPT>
mickaelAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tecbuilderCommented:
In the function gonow change

function gonow(p) {
  location=addr[p];
}

to

function gonow(p) {
  framename.location=addr[p];
}

Where framename is the name of the frame you want the html file to be loaded into.

If you have any questions about this ask before grading?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tecbuilderCommented:
Oops.  I hit the submit button before I was done checking my answer.  The function gonow needs to be changed to

function gonow(p) {
  parent.framename.location=addr[p];
}

I left off the 'parent.' in my first part of the answer.
0
mickaelAuthor Commented:

Hello,

I am getting a merror saying parent.framename has no properties

(this URL is the same stuff but    no Frames: http://www.adarweb.com/vs4/index.html)

Here is my entire left button frame HTML giving me the error:




<HTML>
<HEAD><TITLE>Selnas Buttons</TITLE><meta name="resource-type" content="document">


<SCRIPT language="JavaScript">
<!--
var bn=navigator.appName;
var vn=navigator.appVersion;
var p1=null;
var p2=null;
var p3=null;
var p4=null;
var p5=null;
// Animated menu stuff
function off_img(loc,img) {};
function on_img(loc,img) {};

function gonow(p)
  {
parent.framename.location=addr[p];

location=addr[p];
  };

var addr = new Array(5);
addr[1]="prokiad-intro.html";
addr[2]="selnas-index.html";
addr[3]="presse-index.html";
addr[4]="anglais-index.html";
addr[5]="commande-index.html";
menuimg = new Array(10);
if ((bn!="Microsoft Internet Explorer") || (vn.substring(0,3)!="2.0"))
{
menuimg[1]= new Image (90,53);
menuimg[1].src="prokiad-j-black.jpg";
menuimg[6]= new Image (90,53);
menuimg[6].src="prokiad-v-black.jpg";
menuimg[2]= new Image (90,53);
menuimg[2].src="méthode-j-black.jpg";
menuimg[7]= new Image (90,53);
menuimg[7].src="méthode-v-black.jpg";
menuimg[3]= new Image (90,53);
menuimg[3].src="presse-j-black.jpg";
menuimg[8]= new Image (90,53);
menuimg[8].src="presse-v-black.jpg";
menuimg[4]= new Image (90,53);
menuimg[4].src="anglais-j-black.jpg";
menuimg[9]= new Image (90,53);
menuimg[9].src="anglais-v-black.jpg";
menuimg[5]= new Image (90,53);
menuimg[5].src="commande-j-black.jpg";
menuimg[10]= new Image (90,53);
menuimg[10].src="commande-v-black.jpg";
}
function on_img(loc,img)
  {
  if ((bn!="Microsoft Internet Explorer") || (vn.substring(0,3)!="2.0"))
    loc.src=menuimg[img].src;
  }

// -->
</SCRIPT>



</HEAD>
<body background="../../images/gif/side-j.gif" bgcolor="#FFFFFF" vlink="#0000FF" TEXT="#000000" ALINK="#FF0000">




<table border=0>
<tr>
      <td>

<table border=0 valign="center">
<tr>
      
<td>

<a href="javascript:gonow(1) " target="left_window" onMouseOver="on_img(p1,6);self.status='Les laboratoires Prokiad';return true"onMouseOut= "on_img(p1,1);self.status='Les laboratoires Prokiad';return true">
<img src="prokiad-j-black.jpg" name="p1" alt="Les laboratoires Prokiad" border=0 width="90" height="53"></a>
      </td>

<tr>
      <td>
<a href="javascript:gonow(2)" onMouseOver="on_img(p2,7);self.status='La méthode S.E.L.N.A.S';return true"onMouseOut= "on_img(p2,2);self.status='La méthode S.E.L.N.A.S';return true">
<img src="méthode-j-black.jpg" name="p2" alt="la méthode S.E.L.N.A.S" border=0 width="90" height="53"></a>
      </td>
</tr>

<tr>
      <td>
<a href="javascript:gonow(3)" onMouseOver="on_img(p3,8);self.status='La presse et S.E.L.N.A.S';return true"onMouseOut= "on_img(p3,3);self.status='La presse et S.E.L.N.A.S';return true">
<img src="presse-j-black.jpg" name="p3" alt="La presse et S.E.L.N.A.S" border=0 width="90" height="53"></a>
      </td>
</tr>

<tr>
<td><a href="javascript:gonow(4)" onMouseOver="on_img(p4,9);self.status='Le site S.E.L.N.A.S en Anglais';return true"onMouseOut= "on_img(p4,4);self.status='Le site S.E.L.N.A.S en Anglais';return true">
<img src="anglais-j-black.jpg" name="p4" alt="Le site S.E.L.N.A.S en Anglais" border=0 width="90" height="53"></a>
      </td>
</tr>

<tr>
      <td>
<a href="javascript:gonow(5)" onMouseOver="on_img(p5,10);self.status='Commandez votre calenndrier ON LINE';return true"onMouseOut= "on_img(p5,5);self.status='Commandez votre calenndrier ON LINE';return true">
<img src="commande-j-black.jpg" name="p5" alt="Commandez votre calendrier ON LINE" border=0 width="90" height="53"></a>
      </td>
</tr>
</table>


      </td>

</tr>
</table>



</BODY>
</HTML>


0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

tecbuilderCommented:
Oops!  It seems as though you used parent.framename.location=addr[p] exactly as I said.  Sorry, you misunderstood.  You need to change 'framename' to whatever your right frame name is called.  You may have called it 'right_frame'.  If so then you would use parent.right_frame.location=addr[p]

Let me know if this works.

I did find some things that need to be fixed:
line 89 - remove <TR>
line 185 - remove <TD>
line 195 - add </TR>

I would also suggest using an HTML validator program.  I found about 30 other minor errors.  You can find a validator at http://www.htmlvalidator.com .  It's shareware and you can use it 150 times before it disables itself.
0
tecbuilderCommented:
Note:  The above errors were find on the URL you posted.
0
tecbuilderCommented:
Did my answer work?  If so please grade.  If not, what problem is occuring?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.