js拼接html注意问题示例探讨

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

js拼接html注意问题示例探讨

  2020-05-13 我要评论

你想让别人给你解决什么,
adress是什么,

var hrf='<a href="javascript:;" rel="external nofollow" rel="external nofollow" onclick="window.open('+url+','','"height=625,width=830,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no"')">'+adress+'</a>';

下面又出现adress[j]。用法完全不对。

msg+='<tr style="height:25px"><td align ="left" style="width:6%;color:Black">'+coal[j]+'</td><td align ="left" style="width:8%;color:Black">'+url+hrf+'</td><td align ="left" style="width:24%;color:Black">'+adress[j]+'</td><td align ="left" style="width:12%;color:Green;font-weight :bold">'+ssz[j]+'</td>';

追问

我是想把

<a href="javascript:;" rel="external nofollow" rel="external nofollow" onclick="window.open('+url+','','"height=625,width=830,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no"')">'+adress+'</a>

这句外面加个单引号,可是试了好多次都不成功,这句话加上单引号,里面改怎么变化呢

回答

用转义符, \" = ", \' = '

追问

转义符不太会用,能给个列子吗

回答

var zz ="<tr style=\"height:25px\">";

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们