嘿伙计们,所以我试图将 .png 类型的图片作为参数传递给函数。所以每次我用图片参数调用函数时,图片都会显示出来。这是我的功能
function DisplayImages(picture1){
document.write("<div class='slideshow'>",
"<ul>",
"<li>",
"<img src=",picture1,"/>",
"<div>",
"<a href=", picture1 "title='Click to see full image' target='_blank'>",
"<img src=", picture1 " alt='Item 1' />",
"</a>",
"<p>'This is Item 1' </p>",
"</div>",
"</ul>",
"</div>");
}
我这样称呼它
<script> DisplayImages('images/upcomingitem1.png'); </script>
但它没有显示任何东西,任何帮助如何解决这个问题?