请大家帮我看下这段代码?为什么报Console未定义
<html><head><title></title><scriptlanguage="javascript"type="text/javascript">window....
<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">
window.onload=function()
{
var imgArr=["1.jpg","2.jpg","3.jpg"];
chageImg("test",imgArr,1000*2);
}
function chageImg(id,arr,ms){
var imgSrc=arr[0];
var img=document.getElementById(id);
img.src=imgSrc;
var i=1;
setInterval(function()
{
if(i<arr.length-1)
{
i++;
}
else
{
i=0;
}
img.src=arr[i];
Console.log(new Date().toLocaleString())
},ms);
}
</script>
</head>
<body>
<img id="test" width="200" height="200">
</body>
</html> 展开
<head>
<title></title>
<script language="javascript" type="text/javascript">
window.onload=function()
{
var imgArr=["1.jpg","2.jpg","3.jpg"];
chageImg("test",imgArr,1000*2);
}
function chageImg(id,arr,ms){
var imgSrc=arr[0];
var img=document.getElementById(id);
img.src=imgSrc;
var i=1;
setInterval(function()
{
if(i<arr.length-1)
{
i++;
}
else
{
i=0;
}
img.src=arr[i];
Console.log(new Date().toLocaleString())
},ms);
}
</script>
</head>
<body>
<img id="test" width="200" height="200">
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询