"<a href="#"  onClick="window.open('view.jsp?id=<%=id%>','new','width=572,height=422,top=40,left=100,scrollbars=yes,toolbar=no,resizable=yes,menubar=yes ')">"

解决方案 »

  1.   

    new_str=new_str+"<a href="#" onClick="window.open('view.jsp?id=<%=id%>','title','width=572,height=422,top=40,left=100,scrollbars=yes,toolbar=no,resizable=yes,menubar=yes ')">";
      

  2.   

    <%@ page language="java" pageEncoding="gbk"%>
    <%
    int id=0;
     %>
    <script>
    function func(){
    var new_str="";
    new_str+="<a href='#' ";
    new_str+=" onClick=\"window.open('view.jsp?id= <%=id%> ','title','width=572,height=422,";
    new_str+="top=40,left=100,scrollbars=yes,toolbar=no,resizable=yes,menubar=yes ')\"> ";
    new_str+="test</a>";
    document.getElementById("aa").innerHTML=new_str;
    }
    </script>
    <input type="button" value="test" onclick="func();"/>
    <div id="aa"></div>
      

  3.   

    在双引号里面再用双引号的话,
    语句为:  " aa=\"aa\" "
      

  4.   

    楼上的测试过了吗。请用jsp输出一下好吗?问题不少
      

  5.   

    D:\tomcat\work\Catalina\localhost\_\org\apache\jsp\new_\wjgl\cxwj\view_jsp.java:104: unclosed string literal
    new_str+=" onClick=\"window.open('view.jsp?id=<%=id
                                             ^
      

  6.   

    String new_str=""; //获得新文件编号的超连接形式
    new_str+=" <a href='#'";
    new_str+=" onClick=\"window.open('view.jsp?id=<%=id%>','title','width=572,height=422,"; 
    new_str+="top=40,left=100,scrollbars=yes,toolbar=no,resizable=yes,menubar=yes')\">   "; 
    new_str=new_str+("<font color=\"#FF0000\">");
    new_str=new_str+wh_temp;//wh_temp连接
    new_str=new_str+"</font>";
    new_str=new_str+"</a>";*/这是原码
    其中
    new_str+=" <a href='#'";
    new_str+=" onClick=\"window.open('view.jsp?id=<%=id%>','title','width=572,height=422,"; 
    new_str+="top=40,left=100,scrollbars=yes,toolbar=no,resizable=yes,menubar=yes')\">   "; 
      
    总是转义弄不好,请大家帮忙。
      

  7.   

    我搞定了。谢谢lanzhengwu 我现在结贴子