<?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>过眼•物影天狼 &#187; IE</title>
	<atom:link href="http://www.tangrui.net/category/computer-science-and-technology/web/browser/ie/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tangrui.net</link>
	<description>博客通天下 淡墨书豪辞</description>
	<lastBuildDate>Fri, 29 May 2009 03:25:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>IE 和 Firefox 在行为上的差别</title>
		<link>http://www.tangrui.net/2006/07/03/differences-between-ie-and-firefox</link>
		<comments>http://www.tangrui.net/2006/07/03/differences-between-ie-and-firefox#comments</comments>
		<pubDate>Mon, 03 Jul 2006 07:51:02 +0000</pubDate>
		<dc:creator>Rui Tang</dc:creator>
				<category><![CDATA[计算机科学与技术]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[浏览器]]></category>

		<guid isPermaLink="false">http://www.tangrui.net/?p=54</guid>
		<description><![CDATA[1、在 IE 中，不同的 document 创建的 element 不能够相互 append
有两个 frame，name 分别为 frame1 和 frame2，有如下代码：

var div1 = frame1.document.createElement(&#34;div&#34;);
var div2 = frame2.document.createElement(&#34;div&#34;);
div1.appendChild(div2);


这段代码，在 Firefox 中工作正常，而在 IE 中会报告“无效参数（Invalid Arguments）”。当然, IE 的这种行为是正确且安全的。
2、在 IE 中需要使用规范的属性名称

有如下的 HTML 代码:

&#60;table id=&#34;table1&#34;&#62;&#60;tbody id=&#34;tbody1&#34;&#62;
&#160;&#160;&#160;&#160;&#60;tr&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;td&#62;123&#60;/td&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;td&#62;456&#60;/td&#62;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#60;td&#62;789&#60;/td&#62;
&#160;&#160;&#160;&#160;&#60;/tr&#62;
&#60;/tbody&#62;&#60;/table&#62;

现在用 Javascript 往里面插入一个新行：

var domTr = document.createElement(&#34;tr&#34;);
var domTd = document.createElement(&#34;td&#34;);
domTd.setAttribute(&#34;colSpan&#34;, &#34;3&#34;);
domTd.innerHTML = &#34;123456789&#34;;
domTr.appendChild(domTd);
document.getElementById(&#34;tbody1&#34;).appendChild(domTr);


注意第三行的 colSpan 属性, 在这里如果使用 colspan (也就是说 s 没有大写的话) IE 会无法识别这个属性，但是在 Firefox 里面这两种形式都可以正常工作。
显然 IE [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1、在 IE 中，不同的 document 创建的 element 不能够相互 append</strong></p>
<p>有两个 frame，name 分别为 frame1 和 frame2，有如下代码：</p>
<p><pre><pre>
var div1 = frame1.document.createElement(&quot;div&quot;);
var div2 = frame2.document.createElement(&quot;div&quot;);
div1.appendChild(div2);
</pre></pre></p>
<p>
这段代码，在 Firefox 中工作正常，而在 IE 中会报告“无效参数（Invalid Arguments）”。当然, IE 的这种行为是正确且安全的。</p>
<p><strong>2、在 IE 中需要使用规范的属性名称</strong></p>
<p>
有如下的 HTML 代码:</p>
<p><pre><pre>
&lt;table id=&quot;table1&quot;&gt;&lt;tbody id=&quot;tbody1&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;123&lt;/td&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;456&lt;/td&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;789&lt;/td&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</pre></pre></p>
<p>现在用 Javascript 往里面插入一个新行：</p>
<p><pre><pre>
var domTr = document.createElement(&quot;tr&quot;);
var domTd = document.createElement(&quot;td&quot;);
domTd.setAttribute(&quot;colSpan&quot;, &quot;3&quot;);
domTd.innerHTML = &quot;123456789&quot;;
domTr.appendChild(domTd);
document.getElementById(&quot;tbody1&quot;).appendChild(domTr);
</pre></pre></p>
<p>
注意第三行的 colSpan 属性, 在这里如果使用 colspan (也就是说 s 没有大写的话) IE 会无法识别这个属性，但是在 Firefox 里面这两种形式都可以正常工作。</p>
<p>显然 IE 在这个地方的处理就有些太苛刻了，所以用 IE 来设置 DOM 元素的属性的时候最好按照“第一个单词的首字母小写，其余单词的首字母均大写”的规则来进行。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tangrui.net/2006/07/03/differences-between-ie-and-firefox/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

