时间:2021-07-01 10:21:17 帮助过:23人阅读
代码如下:
<a id="readylink" href="javascript:download();" class="submitbutton">请等待</a>
<a id="downloadlink" href="//www.gxlcms.com/" class="submitbutton" style="display:none;">下载</a>
<script type="text/javascript">
var timeout="25";
function countdown()
{
if (timeout<=0)
{
document.getElementById("readylink").style.display="none";
document.getElementById("downloadlink").style.display="block";
}
if (timeout>0)
{
document.getElementById("readylink").innerHTML='请稍等'+timeout+'秒';
setTimeout("countdown()",1000);
}
timeout--;
}
countdown();
function download() {
if(timeout>0) {
alert('请稍等,服务器正在取得相关资源。');
}
}
</script>