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

你想让别人给你解决什么, 
adress是什么,www.usus.cc


var hrf='<a href="javascript:;" rel="external nofollow" rel="external nofollow" οnclick="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>';追问


我是想把www.usus.cc


<a href="javascript:;" rel="external nofollow" rel="external nofollow" οnclick="window.open('+url+','','"height=625,width=830,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no"')">'+adress+'</a>这句外面加个单引号,可是试了好多次都不成功,这句话加上单引号,里面改怎么变化呢


回答www.usus.cc


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


追问


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


回答www.usus.cc


var zz ="<tr style=\"height:25px\">";
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值