我已经使用以下代码继承了一个项目,我无法通过JSlint - 有人知道需要更改哪些内容吗?
如果我关闭第2行的字符串,则会获得预期'/'
,而是看到''
。
$this.append(
'<a href="' + slideLink + '"' + slideTarget + '>
<span class="slide-time-date"></span>
<div class="slide-overlay-text slide-overlay-text-mobile"' + slideColour + '>
<span>' + slideOverlaytext + '</span>
</div>
<div class="slide-overlay-text slide-overlay-text-tablet"' + slideColour + '>
<span>' + slideOverlaytext + '</span>
</div>
<div class="slide-overlay-text slide-overlay-text-desktop"' + slideColour + '>
<span>' + slideOverlaytext + '</span>
</div>
<img src="' + slideImg + '" alt="' + slideTitle + '" />
</a>'
);
答案 0 :(得分:0)
做这样的事情
$this.append(
'<a href="' + slideLink + '"' + slideTarget + '>\
<span class="slide-time-date"></span>\
<div class="slide-overlay-text slide-overlay-text-mobile"' + slideColour + '>\
<span>' + slideOverlaytext + '</span>\
</div>\
<div class="slide-overlay-text slide-overlay-text-tablet"' + slideColour + '>\
<span>' + slideOverlaytext + '</span>\
</div>\
<div class="slide-overlay-text slide-overlay-text-desktop"' + slideColour + '>\
<span>' + slideOverlaytext + '</span>\
</div>\
<img src="' + slideImg + '" alt="' + slideTitle + '" />\
</a>'
);