HTML: <button id="closeButton" class="btn btn-success" style="size: 26px;width: 240px;height: 40px" οnclick="closetself()">关闭</button>
JS:
function closetself() { window.external.close(); } //倒计时 var time = 5; var timeSet; function loadingclose(){ time=time-1; var closeButton = $("#closeButton"); if(time == 0){ window.external.close(); }else{ closeButton.text("执行完毕("+time+")秒后自动关闭"); timeSet = setTimeout(function() { loadingclose(); },1000) } }