框架指向页面中提交到action
action返回的页面 想跳出框架
但是返回页面不执行js
输出语句都已执行fanhui.jsp<html>
<head>
<script type="text/javascript">
<!--<%System.out.println("aaaaaaaaaaa"); %>
alert("cccccccccc");
window.open('home.do','_top');
<%System.out.println("bbbbbbbbbbbbb"); %>
//-->
</script>
</head>
<body>
</body>
</html>

解决方案 »

  1.   


    <html> 
    <head> 
    <script type="text/javascript"> alert("cccccccccc"); 
    window.open('home.do','_top'); 
    </script> 
    </head> 
    <body> 
    </body> 
    </html>我去掉你的注释能够运行啊.
      

  2.   

    <html> 
    <head> 
    <script type="text/javascript"> 
    <!-- 
    var a  = "<%System.out.println("aaaaaaaaaaa"); %>"
    alert(a); 
    window.open('home.do','_top'); 
    var b = "<%System.out.println("bbbbbbbbbbbbb"); %>"
    //--> 
    </script> 
    </head> 
    <body> 
    </body> 
    </html>即可
      

  3.   

    把注释去掉就行http://forum.csdn.net/PointForum/Forum/PostTopic.aspx?forumID=8b327318-2c42-4a49-8aed-ef8c33697e7f了,因为你把你的javascript代码注释掉了,怎么能执行呢?
      

  4.   


    只是执行输出语句 alert语句 open语句都没执行 不知为什么  难道和在框架中有关吗 打开父窗口 我的open语句对吗
      

  5.   

    <html> 
    <head> 
    <script type="text/javascript"> 
    <!-- 
    var aa ="<% System.out.println('aaaaaaaaaaa'); %>" 
    alert("cccccccccc"); 
    window.open('home.do','_top'); 
    var bb = "<% System.out.println('bbbbbbbbbbbbb'); %>"
    //--> 
    </script> 
    </head> 
    <body> 
    </body> 
    </html>
    -------
    这样也可以啊,open语句也有执行
      

  6.   

    1,无js调用
    2,有javascript代码但被注释
      

  7.   

    <html>
    <head>
    <script type="text/javascript"> 
    function openNew() {
    window.open("home.do","_self"); 
    }</script> 
    </head>
    <body onload="openNew();">
    </body>
    </html>我写成这样也不行 js在框架中 不能打开窗口吗
      

  8.   

    已测试, 可以运行.
    不过你这样做并不能跳出框架. 它只会在_top中打开home.do.
    建议你试一下window.top.location.href='home.do';
      

  9.   

    home.do前改成<%=path%>/home.do试试另外,注释JS语言和css语言,你把注释写完全,养成好的习惯。你上面的语句,我去掉了java语言后能正确执行。
      

  10.   


    我这里是<html> 
    <head> 
    <script type="text/javascript"> 
    function openNew() { 
    alert("========");
    } </script> 
    </head> 
    <body onload="openNew();"> 
    </body> 
    </html> alert都没执行啊 
      

  11.   


    框架指向页面中提交到action 
    action返回的页面 想跳出框架 
    但是返回页面不执行js 
    输出语句都已执行 fanhui.jsp <html> 
    <head> 
    <script type="text/javascript"> 
     
    alert("cccccccccc"); 
    window.open('home.do','_top'); 
    </script> 
    </head> 
    <body> 
    </body> alert都没执行
    </html>
      

  12.   


    我试了不行  主要是js语句不执行  alert都不执行
      

  13.   

    我试了,是可以的:
    <html> 
    <head> 
    <script type="text/javascript"> alert("cccccccccc"); 
    window.open('home.do','_top'); 
    </script> 
    </head> 
    <body> 
    </body> 
    </html>
      

  14.   

    JS跟框架没有任何关系,不论在什么情况下都可以的.
    建议:
    看看字符是否有中文的等,导致JS无法运行,看看是否有JS错误
    另,JS里面的<--  //-->不会对JS运行有影响