0
正如您在標題中可以理解的那樣,我希望在字符串操作中使用單引號。這裏是我的代碼:如何在javascript的字符串操作中使用單引號
headline += '<article><h5><a class="headline" onmouseover="headLineDetail(' + this.HeadCaption + ',' + this.ShortDescription + ',' + this.PicUrl + ',' + this.NewsId + ')" href="NewsDetail.aspx?nid=' + this.NewsId + '"' + '">' + this.HeadCaption + this.time + '</a></h5>';
我必須給報價給headLineDetail的字符串參數。但我將標題附加到div作爲內部html。我如何在這種情況下使用單引號。
你提的問題是非常不清楚。 – SLaks