Using variables to call frameset src with the same name in different folders

203 views Asked by At

I'm trying to create a javascript that takes an input location of a target .html document and displays it in a frame, at the same time it also calls a file in the same folder with a different name to display it to another frame.

My problem starts here since i have multiple folders to which i want to do that to.

How the folders look like ^^ each folder has 2 files which i'm trying to link


This is the error I get:

enter image description here


Code:

<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="Unistyle.css">
  
  <script>
   function CallSite(Plocation)
   {
    parent.MainBody.location=Plocation;
    parent.Opis.location=Plocation/opis.html;
   }
  </script>
  
 </head>
 <body id="globalBG">
  <h1><b>Kazalo</b></h1>
  <div style="padding-top:1px;padding-bottom:1px;color:aliceblue;background-color:#201010">  
   <ol>
   <li><a href="javascript:CallSite('pages/1/1stran.html')" target="MainBody">Naloga</a></li>
   <li><a href="javascript:CallSite('pages/2/drzave.html')" target="MainBody">Naloga</a></li>
   </ol>
  </div>
 </body>
</HTML>

I do know hat the 2nd part of the function to which i call the opis.html file is wrong, however i have no idea how to correctly write that piece of code

0

There are 0 answers