日期:2014-05-18  浏览次数:20394 次

这段js代码哪块不对?
<html>
<head   >
<title> Untitled   Page </title>

        <script   type= "text/javascript ">

        function   GoTo(url)
        {
              window.Frames[ "mainFrame "].location=url;
               
        }
        </script>

</head>
<body>
                <table   border= "0 "   cellpadding= "0 "   cellspacing= "0 "   style= "width:   1000px;   margin:0px;   ">
                        <tr>
                                <td   style= "height:50px;   width:   100%; ">
<iframe   id= "mainFrame "     title= "mainFrame "   frameborder= "0 "   name= "mainFrame "   src= " "   />
                                </td>
                      </tr>
</table>
   
</body>
</html>
      <script   language= "javascript ">
GoTo( 'c.html ');
  </script>

------解决方案--------------------
window.Frames[ "mainFrame "].location=url;
应该是
window.frames[ "mainFrame "].location=url;


<iframe id= "mainFrame " title= "mainFrame " frameborder= "0 " name= "mainFrame " src= " " />
好像该用
<iframe id= "mainFrame " title= "mainFrame " frameborder= "0 " name= "mainFrame " src= " "> </iframe>