title: Frames in javascript
body: <pre><code>&lt;FRAMESET COLS="*,*" ONLOAD="selectFrames()" ONUNLOAD="alert('stopped')"
  &lt;FRAME SRC = "frames/grey.htm" NAME="firstFrame"&gt;
  
  
  &lt;/FRAMESET&gt;
  &lt;script language="javascript"&gt;
  
  function selectFrames(){
  base="frame/"
  newFrames = new Array("red.htm","blue.htm","pink.htm","grey.htm")
  window.firstFrame.location = base+newFrames[Math.round(5*Math.random())%5] 
  window.secondFrame.location = base+newFrames[Math.round(5*Math.random())%5] 
  }
  </code></pre>
  
  <p></p>
  
  <p>its a simple setting frames in grey color buti do not know why is that code is not working. console error is set property location is undefined can anyone guide me about the location of existing code.</p>