復制代碼 代碼如下:
<a id="readylink" href="javascript:download();" class="submitbutton">請等待</a>
<a id="downloadlink" href="http://www.jb51.net/" 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>