Home >php教程 >php手册 >点击短信发送计时器

点击短信发送计时器

WBOY
WBOYOriginal
2016-06-06 19:39:22968browse

用jquery写个简单的短信发送新手 input type="button" id="btn" value="发送短信"script type="text/javascript" src="/jquery/jquery.js"var count_time= 60;//定义规定的时间,60秒后再次发送function start_timer(){if(count_time == 0){$('#btn').remove

用jquery 写个简单的短信发送 新手

<input type="button" id="btn" value="发送短信">
<script type="text/javascript"  src="/jquery/jquery.js">
	var count_time= 60;//定义规定的时间,60秒后再次发送
	function start_timer()
	{
		
		if(count_time == 0)
		{
			$('#btn').removeAttr("disabled");
			$('#btn').val("重新发送");
			count_time= 60;
		}else
		{
			$('#btn').attr("disabled",true);
			$('#btn').val("重新发送("+count_time+")");
			count_time--;
			setTimeout(function(){start_timer();},1000);
		}

	}

	$('#btn').click(function(){
		start_timer();
	});
</script>

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