妥了,L@_@K <body>
<img src="http://www.csdn.net/ui/styles/public_header_footer/logo_csdn.gif" id="imgShow" />
<script type="text/javascript">
<!--
var oImg = document.getElementById("imgShow");
var arrImgUrl = new Array();
arrImgUrl[0] = "http://www.baidu.com/img/logo.gif";
arrImgUrl[1] = "http://www.csdn.net/ui/styles/public_header_footer/logo_csdn.gif";
var i = 0;
function showImage()
{
if (i==arrImgUrl.length) i = 0;
oImg.src = arrImgUrl[i++];
}window.setInterval(showImage, 1000);
//-->
</script>
</body>
<img src="http://www.csdn.net/ui/styles/public_header_footer/logo_csdn.gif" id="imgShow" />
<script type="text/javascript">
<!--
var oImg = document.getElementById("imgShow");
var arrImgUrl = new Array();
arrImgUrl[0] = "http://www.baidu.com/img/logo.gif";
arrImgUrl[1] = "http://www.csdn.net/ui/styles/public_header_footer/logo_csdn.gif";
var i = 0;
function showImage()
{
if (i==arrImgUrl.length) i = 0;
oImg.src = arrImgUrl[i++];
}window.setInterval(showImage, 1000);
//-->
</script>
</body>
我刚才试了一下,本地没有问题,可我奇怪的是我为什么上传到网站上就不可以了呢?显示图片都为UNDIFINED.为什么呢?
图片轮换显示为undefined.