strTopContentHTML +="<a href='#' onclick='window.open('http://baidu.com','newwindow', 'height=50, width=400,top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')'>" + latpRec("latp_latestfunctionname") + 
"</a>  ";上面这样报错,不知是不是"符号跟'符号不能同时使用的缘故.

解决方案 »

  1.   

    是你的单引号没有正确匹对,window.open里的单引号要转义 。
      

  2.   

    strTopContentHTML +="<a href='#' onclick=\"window.open('http://baidu.com','newwindow', 'height=50,  width=400,top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') 
    \">" + latpRec("latp_latestfunctionname") + 
    "</a> ";你这个latpRec("latp_latestfunctionname") 是怎么回事?哪里来的?服务器的还是客户端的?
    如果是服务器的换成
    strTopContentHTML +="<a href='#' onclick=\"window.open('http://baidu.com','newwindow', 'height=50,  width=400,top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') 
    \">" + <%=latpRec("latp_latestfunctionname")%> + 
    "</a> ";
      

  3.   


    strTopContentHTML +=" <a href='#' onclick=\"window.open('http://baidu.com','newwindow', 'height=50,  width=400,top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') 
    \">" + <%=latpRec("latp_latestfunctionname")%> + 
    " </a> ";你这个我试过了,运行不了.
    latpRec("latp_latestfunctionname") 这个是从数据库读取数据的意思.
      

  4.   


    <p>
    <font face="宋体" size=2>未结束的字符串常量</font>
    <p>
    <font face="宋体" size=2>/crm61/CustomPages/LatestPose/LatestPoseGrid.asp</font><font face="宋体" size=2>,行 23</font>
    <pre>strTopContentHTML +=&quot; &lt;a href='#' onclick=\&quot;window.open('http://baidu.com','newwindow', 'height=50,  width=400,top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^</pre>  报这个错误,谢谢
      

  5.   

    latpRec("latp_latestfunctionname")是字符串吗?
    var s='<%=latpRec("latp_latestfunctionname")%>'strTopContentHTML +=" <a href='#' onclick=\"window.open('http://baidu.com','newwindow', 'height=50,  width=400,top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
    \">" + s +
    " </a> ";
    再试一下
      

  6.   

    http://topic.csdn.net/u/20090707/14/fb870b80-45e3-4e0a-bfb7-87b4b12e837c.html?28695
    上面8楼代码是你的吧?
    我看糊涂了。
    你把代码贴全吧,免得浪费时间
      

  7.   

    test.asp<script>
    var strTopContentHTML ="";
    strTopContentHTML +="<a href='#' onclick=\"window.open('http://baidu.com','newwindow', 'height=50,  width=400,top=250, left=250, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
    \">" + 123 + "</a> ";
    document.write(strTopContentHTML);</script>
    你全盘拷贝我的代码试一下,我只不过把<%=latpRec("latp_latestfunctionname")%>换成123了。怀疑你把JS/HTML/服务端VBS全搞混了,所以请贴全代码。呵呵