<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kane&#039;s Blog &#187; focus</title>
	<atom:link href="http://iamkane.com/index.php/archives/tag/focus/feed" rel="self" type="application/rss+xml" />
	<link>http://iamkane.com</link>
	<description>Bug can be anywhere,Can you find it?</description>
	<lastBuildDate>Mon, 21 Jun 2010 11:05:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>blur 与 focus 事件相处之道</title>
		<link>http://iamkane.com/index.php/archives/171</link>
		<comments>http://iamkane.com/index.php/archives/171#comments</comments>
		<pubDate>Wed, 10 Mar 2010 06:23:29 +0000</pubDate>
		<dc:creator>Kane</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[blur]]></category>
		<category><![CDATA[focus]]></category>

		<guid isPermaLink="false">http://iamkane.com/?p=171</guid>
		<description><![CDATA[表单的处理一般分成2种： field 单独 onblur 时进行验证并提示 与 在提交表单时验证全部 field (并行与单独验证)。 今天遇到了一个问题，可以说是低级错误。单独说一下 每个 field onblur 时验证的问题。 &#60;input type=&#34;text&#34; onblur=&#34;test(this)&#34; /&#62; function test(o){ if(document.getElementById(o).value=='') { alert('test'); document.getElementById(o).focus(); } } 上面这种情况下是可以正常运行，但下面的情况是当多个field需要同时验证的时候就有问题了 &#60;input type=&#34;text&#34; onblur=&#34;test(this)&#34; /&#62; &#60;input type=&#34;text&#34; onblur=&#34;test(this)&#34; /&#62; function test(o){ if(document.getElementById(o).value=='') { alert('test'); document.getElementById(o).focus(); } } 在这种情况下会出现死循环，到时IE 卡死 cpu100% 。解决方法就是多field的时候，不能 又blur又focus。 鱼与熊掌不可兼得也&#8230;]]></description>
			<content:encoded><![CDATA[<p>表单的处理一般分成2种： field 单独 onblur 时进行验证并提示 与 在提交表单时验证全部 field (并行与单独验证)。 今天遇到了一个问题，可以说是低级错误。单独说一下 每个 field onblur 时验证的问题。</p>
<pre class="brush: xml;">

&lt;input type=&quot;text&quot; onblur=&quot;test(this)&quot; /&gt;

function test(o){
   if(document.getElementById(o).value=='')
   {
       alert('test');
       document.getElementById(o).focus();
    }
}
</pre>
<p>上面这种情况下是可以正常运行，但下面的情况是当多个field需要同时验证的时候就有问题了</p>
<pre class="brush: xml;">

&lt;input type=&quot;text&quot; onblur=&quot;test(this)&quot; /&gt;
&lt;input type=&quot;text&quot; onblur=&quot;test(this)&quot; /&gt;
function test(o){

if(document.getElementById(o).value=='')
 {
 alert('test');
 document.getElementById(o).focus();
 }
}
</pre>
<p>在这种情况下会出现死循环，到时IE 卡死 cpu100% 。解决方法就是多field的时候，不能 又blur又focus。 鱼与熊掌不可兼得也&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://iamkane.com/index.php/archives/171/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
