<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post/5994/</link>
<title><![CDATA[[Js运用]点击获取验证码60秒记时的Js实现方法。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Tue, 29 Jan 2013 09:11:20 +0000</pubDate> 
<guid>http://jackxiang.com/post/5994/</guid> 
<description>
<![CDATA[ 
	1）纯Js实现来自PHP高级群中庸就是春江：<br/><textarea name="code" class="JS" rows="15" cols="100">
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;body&gt;
&lt;input type=&quot;button&quot; id=&quot;getCode&quot; value=&quot;Test&quot; /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function $ (o)&#123;
&nbsp;&nbsp;return document.getElementById(o);
&#125;
var T = 60;
var handle = null;
$(&#039;getCode&#039;).onclick = countDown;

function countDown() &#123;
&nbsp;&nbsp;&nbsp;&nbsp;if(T == 0)&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clearTimeout(handle);
&nbsp;&nbsp;handle = null;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#039;getCode&#039;).value = &#039;重新获取&#039;;
&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&nbsp;&nbsp;else&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#039;getCode&#039;).value = (T + &#039;秒后可重新获取&#039;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T --;
&nbsp;&nbsp;handle = handle ? handle : setInterval(arguments.callee, 1000);
&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&#125;
&lt;/script&gt;
&lt;/body&gt;

</textarea><br/><br/>2）用Jquery实现，PHP高级群单曲实现：<br/><textarea name="code" class="JS" rows="15" cols="100">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;&gt;&lt;/script&gt;&nbsp;&nbsp;
&lt;script&gt;!window.jQuery &amp;&amp; document.write(&#039;&lt;script src=&quot;js/jquery-1.4.2.min.js&quot;&gt;&lt;&#92;/script&gt;&#039;)&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/script&gt;
&lt;script language=&quot;javascript&quot;&gt;
var T = 60;
var handle = null;
$(function()&#123;
&nbsp;&nbsp;&nbsp;&nbsp;$(&#039;#getCode&#039;).click(function()&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;countDown();
&nbsp;&nbsp;&nbsp;&nbsp;&#125;);
&#125;);
function countDown()
&#123;
&nbsp;&nbsp;&nbsp;&nbsp;if(T == 0)&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clearTimeout(handle);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#039;#getCode&#039;).val(&#039;重新获取&#039;);
&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&nbsp;&nbsp;&nbsp;&nbsp;else&#123;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$(&#039;#getCode&#039;).val(T+&#039;秒后可重新获取&#039;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T = T - 1;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;handle = setTimeout(&#039;countDown()&#039;, 1000);
&nbsp;&nbsp;&nbsp;&nbsp;&#125;
&#125;
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&quot;button&quot; id=&quot;getCode&quot; value=&quot;Test&quot; /&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea>
]]>
</description>
</item><item>
<link>http://jackxiang.com/post/5994/#blogcomment63966</link>
<title><![CDATA[[评论] [Js运用]点击获取验证码60秒记时的Js实现方法。]]></title> 
<author>打算 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 20 Mar 2015 08:52:17 +0000</pubDate> 
<guid>http://jackxiang.com/post/5994/#blogcomment63966</guid> 
<description>
<![CDATA[ 
	注册时
]]>
</description>
</item>
</channel>
</rss>