横幅广告每隔一天自动切换一张
<body> <a target="_blank" id="a"><img id="img" /></a> <script type="text/javascript"> var imgSrc = new Date().getDate() +'.jpg'; document.getElementById('img').src = imgSrc; document.getElementById('a').href = imgSrc ; alert('当前显示的图片名为:' + imgSrc); </script> <img id="img" /> <script type="text/javascript"> var imgSrc = 'http://www.gzzhizhu.com/gz/image/' + new Date().getDate() +'.jpg'; //测试一天换一张 //var imgSrc ='http://www.gzzhizhu.com/gz/image/' + new Date().getSeconds() +'.jpg'; //测试一秒换一张 //var imgSrc ='http://www.gzzhizhu.com/gz/image/' + new Date().getMinutes() +'.jpg'; //测试一分换一张 document.getElementById('img').src = imgSrc; alert('当前显示的图片名为:' + imgSrc); </script> </body>