我的数组如下所示:
var imagetitle = new Array()
imagetitle[0] = "One two tree";
imagetitle[1] = "Zero One seven abc";
imagetitle[2] = "qwe qwe qwe";
imagetitle[3] = "rerere erere weqwe";
Imagetitle 稍后在 HTML 中用作标题。问题是当我这样使用它时,它只显示字符串的第一个单词,而不是完整的字符串。
function showimage() {
var div_sa_slikom = document.createElement("div");
div_sa_slikom.innerHTML = "<a href="+imagetarget[i_image]+" title="+imagetitle[i_image]+" target='_parent'><img style='border:none;' src="+imageurl[i_image]+" border='0' title="+imagetitle[i_image]+" alt="+imagetitle[i_image]+" /></a>";
var container = document.getElementById("slike_rotator");
container.appendChild(div_sa_slikom);
}