当前位置: 代码迷 >> ASP.NET >> 这段js代码哪块不对?该如何解决
  详细解决方案

这段js代码哪块不对?该如何解决

热度:6463   发布时间:2013-02-25 00:00:00.0
这段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 ');
  </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>
  相关解决方案