﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-&lt;b&gt;逍遥游&lt;/b&gt;          -随笔分类-AJAX</title><link>http://www.blogjava.net/magicdoom/category/7896.html</link><description>&lt;h1&gt;南哥&lt;/h1&gt;</description><language>zh-cn</language><lastBuildDate>Sun, 21 Oct 2012 16:51:55 GMT</lastBuildDate><pubDate>Sun, 21 Oct 2012 16:51:55 GMT</pubDate><ttl>60</ttl><item><title>MSXML4的乱码问题</title><link>http://www.blogjava.net/magicdoom/archive/2006/03/01/32985.html</link><dc:creator>南哥</dc:creator><author>南哥</author><pubDate>Wed, 01 Mar 2006 03:26:00 GMT</pubDate><guid>http://www.blogjava.net/magicdoom/archive/2006/03/01/32985.html</guid><wfw:comment>http://www.blogjava.net/magicdoom/comments/32985.html</wfw:comment><comments>http://www.blogjava.net/magicdoom/archive/2006/03/01/32985.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/magicdoom/comments/commentRss/32985.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/magicdoom/services/trackbacks/32985.html</trackback:ping><description><![CDATA[最近在利用msxml开发时遇到中文乱码问题，经过查资料，原来是对于msxml4.dll：其中的9004,9818版本存在中文字符集支持的问题。解决办法是换成高版本的，如果安装高版本后还是不行的话，可以手动覆盖system32下的msxml4.dll和msxml4r.dll两个文件。<img src ="http://www.blogjava.net/magicdoom/aggbug/32985.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/magicdoom/" target="_blank">南哥</a> 2006-03-01 11:26 <a href="http://www.blogjava.net/magicdoom/archive/2006/03/01/32985.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JavaScript中容易被误解的两个地方</title><link>http://www.blogjava.net/magicdoom/archive/2006/02/27/32608.html</link><dc:creator>南哥</dc:creator><author>南哥</author><pubDate>Mon, 27 Feb 2006 03:33:00 GMT</pubDate><guid>http://www.blogjava.net/magicdoom/archive/2006/02/27/32608.html</guid><wfw:comment>http://www.blogjava.net/magicdoom/comments/32608.html</wfw:comment><comments>http://www.blogjava.net/magicdoom/archive/2006/02/27/32608.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/magicdoom/comments/commentRss/32608.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/magicdoom/services/trackbacks/32608.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18.75pt; TEXT-INDENT: -18.75pt; mso-list: l0 level1 lfo1; tab-stops: list 18.75pt"><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US>js</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的变量作用域</SPAN><SPAN lang=EN-US>(Variable Scope)<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></B></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18.75pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</SPAN><SPAN lang=EN-US>java,c++</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中不同的地方是，</SPAN><SPAN lang=EN-US>js</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中没有块作用域</SPAN><SPAN lang=EN-US>(Block Scope)</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。变量的作用域将从声明一直持续到</SPAN><SPAN lang=EN-US>function</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的结尾。看个例子就会明白了。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 4.9pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: .49" align=left><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0000c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&nbsp;&nbsp; function</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"> testScope()</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 5pt; TEXT-ALIGN: left; mso-layout-grid-align: none; mso-char-indent-count: .5" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&nbsp;&nbsp; {</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0000c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">var</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"> a = </SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">"a"</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</SPAN></SPAN><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0000c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">function</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"> g() { </SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0064c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">alert</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">(a); }</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>g();<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">//</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">这里输出结果为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">a </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">，因为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">a</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">的作用域将持续到</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">function<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>testScope</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">的结尾</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0000c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">for</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">(</SPAN><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0000c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">var</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"> i=0; i&lt;2; i++)</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0000c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">var</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"> a = </SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">"a is changed"</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">;<SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">//</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">这里的变量</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">a</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">将覆盖开始声明的变量</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">a</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</SPAN></SPAN><B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0000c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">var</SPAN></B><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"> b = </SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">"b"</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">;<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">//b</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">的作用域从声明一直到</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">function</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">的结尾</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0064c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">alert</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">(a);<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">// </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">输出结果为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>a is changed</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"> js</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">首先查找到的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">a</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">是在循环中定义的那个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: #0064c8; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">alert</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">(b);<SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">// </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">输出为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"> b<SPAN style="mso-spacerun: yes">&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">java</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">中</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">,</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">此时将访问不到变量</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">b,b</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">已经出了作用域</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">,</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">但是在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">js</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Courier New'; mso-hansi-font-family: 'Courier New'; mso-bidi-font-family: 'Courier New'; mso-font-kerning: 0pt">中是可以的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: olive; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">.</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">&nbsp;&nbsp; }<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18.75pt"><SPAN lang=EN-US><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><SPAN lang=EN-US style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><STRONG><SPAN lang=EN-US>2. js</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中的垃圾回收（</SPAN><SPAN lang=EN-US>garbage collection</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）</SPAN></STRONG></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN><SPAN style="mso-spacerun: yes">&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>js</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也是一门采用垃圾回收机制的语言，和</SPAN><SPAN lang=EN-US>java</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一样。</SPAN><SPAN lang=EN-US>js</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的解释器负责分配和回收内存。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US><SPAN style="mso-spacerun: yes">&nbsp;</SPAN></SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序员无需像</SPAN><SPAN lang=EN-US>C</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">＋＋中那样手动用</SPAN><SPAN lang=EN-US>delete</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">释放内存。</SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">但是</SPAN><SPAN lang=EN-US>js</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">也有</SPAN><SPAN lang=EN-US>delete</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">关键字</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 10.5pt">，<STRONG>它是用来</STRONG></SPAN><SPAN style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-bidi-font-size: 10.5pt"><STRONG>删除对象的属性，或者删除数组中的指定元素</STRONG>。并不能删除对象本身。用法如下：</SPAN><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: Arial; mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 4" align=left><A name=1037447><B><SPAN style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: ˎ̥; mso-hansi-font-family: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">语法</SPAN></B></A><SPAN style="mso-bookmark: 1037447"><B><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></B></SPAN></P><SPAN style="mso-bookmark: 1037447"></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><A name=1037452><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">delete objectName.property<BR>delete objectName[index]<BR>delete property</SPAN></A><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> <A name=1037499></A><A name=Head3;></A><SPAN style="mso-bookmark: 1037499"><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 4" align=left><SPAN style="mso-bookmark: 1037499"><B><SPAN style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: ˎ̥; mso-hansi-font-family: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">参数</SPAN></B></SPAN><SPAN style="mso-bookmark: 1037499"><B><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"><o:p></o:p></SPAN></B></SPAN></P><SPAN style="mso-bookmark: 1037499"></SPAN>
<TABLE class=MsoNormalTable style="mso-cellspacing: 1.5pt" cellPadding=0 border=0>
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes">
<TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #ece9d8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><A name=1037538></A><A name=1037697></A><SPAN style="mso-bookmark: 1037538"><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">objectName</SPAN></SPAN><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> <o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #ece9d8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><A name=1037540><SPAN style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: ˎ̥; mso-hansi-font-family: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">要删除属性或元素的对象。</SPAN></A><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> <o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 1">
<TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #ece9d8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-size: 10.5pt">property</SPAN><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> <o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #ece9d8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><A name=1037733><SPAN style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: ˎ̥; mso-hansi-font-family: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">要删除的属性。</SPAN></A><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> <o:p></o:p></SPAN></P></TD></TR>
<TR style="mso-yfti-irow: 2; mso-yfti-lastrow: yes">
<TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #ece9d8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><A name=1037742><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">index</SPAN></A><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> <o:p></o:p></SPAN></P></TD>
<TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 0.75pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 0.75pt; PADDING-BOTTOM: 0.75pt; BORDER-LEFT: #ece9d8; PADDING-TOP: 0.75pt; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align=left><A name=1037744><SPAN style="COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: ˎ̥; mso-hansi-font-family: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">要删除的数组元素的序号。</SPAN></A><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt"> <o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 15.75pt; mso-char-indent-count: 1.5"><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="COLOR: black; FONT-FAMILY: ˎ̥; mso-bidi-font-family: 宋体; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt">第三种用法delete property</SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">只能在</SPAN><SPAN lang=EN-US> with </SPAN><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">语句中使用，用来删除对象的属性。<BR></SPAN><SPAN lang=EN-US style="mso-bidi-font-size: 10.5pt"><o:p><BR>补充：在微软的JScript中有CollectGarbage()函数可以用来回收内存，官方文档不推荐使用此方法，你的程序不应该依赖此方法。IE在最小化的时候会进行回收内存。<BR>&nbsp;&nbsp; <BR><BR><BR></o:p></SPAN></P><img src ="http://www.blogjava.net/magicdoom/aggbug/32608.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/magicdoom/" target="_blank">南哥</a> 2006-02-27 11:33 <a href="http://www.blogjava.net/magicdoom/archive/2006/02/27/32608.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>