<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://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>https://jackxiang.com/post/5118/</link>
<title><![CDATA[javascript中如何确定undefine。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Thu, 12 Apr 2012 09:01:25 +0000</pubDate> 
<guid>https://jackxiang.com/post/5118/</guid> 
<description>
<![CDATA[ 
	　一个问题，怎样在js中判断一个对象是null还是undefined，我总结了一下，对于undefined推荐使用===（注意是三个等号，bt吧）或使用typeof，为什么呢？<br/><br/>　　先看一段Code<br/><br/>var obj;<br/>alert(obj ==　null);<br/>alert(obj == undefined);<br/><br/>　　结果是什么？true,true那obj到底是undefined呢还是defined呢？当然是defined的了，而且是null，显然通过==是区分不了的，那要将==替换为===呢？结果就是false，true，个中原因我就不说了，（偷一下懒　:-) ）,那如何区分呢？应该使用===或者是typeof,用法？很简单：<br/><br/>　　if(typeof obj == &quot;undefined&quot;)<br/><br/>　　if(obj === undefined)<br/><br/><br/><br/>实践Ok的代码片段：<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;title&gt;Js实践实例&lt;/title&gt;
&lt;script language=&quot;javascript&quot;&gt;
//var ip2isp = &#039;&#039;;
//方法一：
if(typeof ip2isp != &quot;undefined&quot;)
&#123;
&nbsp;&nbsp;alert(&quot;defined.&quot;);
&#125;else&#123;
&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;undefined.&quot;);&nbsp;&nbsp;
&#125;
//下面这一种方法也成
if(typeof ip2isp&nbsp;&nbsp;=== &quot;undefined&quot;)
&#123;
&nbsp;&nbsp;alert(&quot;undefined.&quot;);
&#125;else&#123;
&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;defined.&quot;);&nbsp;&nbsp;
&#125;
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;

</textarea>
]]>
</description>
</item><item>
<link>https://jackxiang.com/post/5118/#blogcomment63705</link>
<title><![CDATA[[评论] javascript中如何确定undefine。]]></title> 
<author>hxngb1gf &lt;unod61@mail114.net&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Fri, 20 Apr 2012 11:46:18 +0000</pubDate> 
<guid>https://jackxiang.com/post/5118/#blogcomment63705</guid> 
<description>
<![CDATA[ 
	我比较喜欢楼主名字很好听
]]>
</description>
</item><item>
<link>https://jackxiang.com/post/5118/#blogcomment63728</link>
<title><![CDATA[[评论] javascript中如何确定undefine。]]></title> 
<author>hxngb0zf &lt;mhwa904@domozmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 10 May 2012 20:47:01 +0000</pubDate> 
<guid>https://jackxiang.com/post/5118/#blogcomment63728</guid> 
<description>
<![CDATA[ 
	好的，真长见识了，说得很有道理
]]>
</description>
</item>
</channel>
</rss>