Home > php教程 > php手册 > body text

点击短信发送计时器

WBOY
Release: 2016-06-06 19:39:22
Original
897 people have browsed it

用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>
Copy after login

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!