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") +
"</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> ";
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") 这个是从数据库读取数据的意思.
<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 +=" <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')
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^</pre> 报这个错误,谢谢
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> ";
再试一下
上面8楼代码是你的吧?
我看糊涂了。
你把代码贴全吧,免得浪费时间
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全搞混了,所以请贴全代码。呵呵