Home  >  Article  >  Backend Development  >  请教倒计时结束后再自动提交数据如何在基础上写

请教倒计时结束后再自动提交数据如何在基础上写

WBOY
WBOYOriginal
2016-06-13 12:26:211307browse

请问倒计时结束后再自动提交数据怎么在基础上写?


    倒计时结束提交数据
    <script></script>
    <script><br /> $(function () {<br /> $('#btn').click(function () {<br /> var count = 10;<br /> var countdown = setInterval(CountDown, 1000);<br /> function CountDown() {<br /> $("#btn").attr("disabled", true);<br /> $("#btn").val("还剩 " + count + " 秒结束 !");<br /> if (count == 0) {<br /> $("#btn").val("再来").removeAttr("disabled");<br /> clearInterval(countdown);<br /> }<br />count--;<br /> }<br /> })<br /> });<br /> </script>






请问倒计时结束后再自动提交数据怎么在基础上写? 就是说倒计时结束才自动提交数据,不结束不提交
------解决思路----------------------
                    if (count == 0) {
                        $.post(url, data);
                        $("#btn").val("再来").removeAttr("disabled");
                        clearInterval(countdown);
                    }
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn