<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: MIME Type 引出的两难困境</title>
	<atom:link href="http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/</link>
	<description>Random notes &#38; thoughts by Jiang Jiang.</description>
	<lastBuildDate>Thu, 02 Feb 2012 01:25:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: phota</title>
		<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/comment-page-1/#comment-8425</link>
		<dc:creator>phota</dc:creator>
		<pubDate>Sat, 14 Oct 2006 12:48:36 +0000</pubDate>
		<guid isPermaLink="false">http://jjgod.3322.org/2004/11/14/mime-type-oyouaaana/#comment-8425</guid>
		<description>&lt;p&gt;Internet Explorer 6+ supports two rendering modes, called Quirks mode and Standards mode. When Internet Explorer renders a page that contains a valid XHTML (or HTML 4.0) DOCTYPE, it renders the page in Standards mode; otherwise, it renders the page in Quirks mode (for details, see CSS Enhancements in Internet Explorer 6).&lt;/p&gt;

&lt;p&gt;The Opera browser (Opera 7+) supports the same two rendering modes (Quirks and Standards) as Internet Explorer (for details, see http://www.opera.com/docs/specs/doctype/).&lt;/p&gt;

&lt;p&gt;Mozilla Firefox 1+ supports three rendering modes: Quirks mode, Almost Standards mode, and Standards mode. Firefox&#039;s Almost Standards mode corresponds to Internet Explorer&#039;s and Opera&#039;s Standards mode. When a page contains a valid XHTML 1.0 Transitional DOCTYPE (and it is served with a text/html MIME type), Firefox renders the page in Almost Standards mode. When a page contains either an XHTML 1.0 Strict or XHTML 1.1 DOCTYPE (or the page is served with an XML MIME type), the page is rendered in Standards mode (for details, see http://www.mozilla.org/docs/web-developer/quirks/doctypes.html). &lt;/p&gt;

&lt;p&gt;You can determine a browser&#039;s current rendering mode by temporarily adding the following client-side script to a page (this script works in the latest versions of Internet Explorer, Firefox, and Opera).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;script type=&quot;text/javascript&quot;&gt;
    alert( document.compatMode );
&lt;/script&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You need to care about the browser rendering mode, because it affects the way in which Cascading Style Sheets are applied to the page. If you convert your existing HTML pages into XHTML pages, they might look very different when you open them in your browser.&lt;/p&gt;

&lt;p&gt;For example, Internet Explorer calculates the size of page elements in different ways, depending on the rendering mode (it uses a different CSS Box Model). In Quirks mode, the width of an element is calculated by summing the width of the element&#039;s content, padding, borders, and margins. In Standards mode, the width of an element is calculated by taking into account only the width of the element&#039;s content. &lt;/p&gt;

&lt;p&gt;For example, consider the following two  tags.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;div style=&quot;width:400px;border:solid 1px black&quot;&gt;
First Box
&lt;/div&gt;

&lt;div style=&quot;width:400px;border:solid 1px black;padding:10px&quot;&gt;
Second Box
&lt;/div&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The two  elements are the same, except for the second  element&#039;s additional padding. In Quirks mode (see Figure 2), the two  elements appear to be the same size, because the additional padding of the second  element is taken into account when calculating its width (the total width of both elements is 400px). In Standards mode (see Figure 3), the second  element appears wider than the first  element, because padding is not taken into account when calculating the width of an element (the total width of both elements is wider than 400px).&lt;/p&gt;

&lt;p&gt;Figure 2. Quirks mode&lt;/p&gt;

&lt;p&gt;Figure 3. Standards mode &lt;/p&gt;

&lt;p&gt;This is only one example of browser differences in Quirks mode. In Quirks mode, each browser implements the W3C Cascading Style Sheet standards in significantly different ways. The beautiful thing about switching to Standards mode is that it forces almost all modern browsers to interpret the W3C standards in a very similar way (not exactly the same, but much better).&lt;/p&gt;

&lt;p&gt;If you want your Web pages to appear in the same way across browsers, then it is a good idea to trigger Standards mode (in Internet Explorer and Opera) and Almost Standards mode (in Firefox), by including an XHTML 1.0 Transitional DOCTYPE.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Internet Explorer 6+ supports two rendering modes, called Quirks mode and Standards mode. When Internet Explorer renders a page that contains a valid XHTML (or HTML 4.0) DOCTYPE, it renders the page in Standards mode; otherwise, it renders the page in Quirks mode (for details, see CSS Enhancements in Internet Explorer 6).</p>

<p>The Opera browser (Opera 7+) supports the same two rendering modes (Quirks and Standards) as Internet Explorer (for details, see <a href="http://www.opera.com/docs/specs/doctype/" rel="nofollow">http://www.opera.com/docs/specs/doctype/</a>).</p>

<p>Mozilla Firefox 1+ supports three rendering modes: Quirks mode, Almost Standards mode, and Standards mode. Firefox&#8217;s Almost Standards mode corresponds to Internet Explorer&#8217;s and Opera&#8217;s Standards mode. When a page contains a valid XHTML 1.0 Transitional DOCTYPE (and it is served with a text/html MIME type), Firefox renders the page in Almost Standards mode. When a page contains either an XHTML 1.0 Strict or XHTML 1.1 DOCTYPE (or the page is served with an XML MIME type), the page is rendered in Standards mode (for details, see <a href="http://www.mozilla.org/docs/web-developer/quirks/doctypes.html" rel="nofollow">http://www.mozilla.org/docs/web-developer/quirks/doctypes.html</a>). </p>

<p>You can determine a browser&#8217;s current rendering mode by temporarily adding the following client-side script to a page (this script works in the latest versions of Internet Explorer, Firefox, and Opera).</p>

<pre><code>&lt;script type="text/javascript"&gt;
    alert( document.compatMode );
&lt;/script&gt;
</code></pre>

<p>You need to care about the browser rendering mode, because it affects the way in which Cascading Style Sheets are applied to the page. If you convert your existing HTML pages into XHTML pages, they might look very different when you open them in your browser.</p>

<p>For example, Internet Explorer calculates the size of page elements in different ways, depending on the rendering mode (it uses a different CSS Box Model). In Quirks mode, the width of an element is calculated by summing the width of the element&#8217;s content, padding, borders, and margins. In Standards mode, the width of an element is calculated by taking into account only the width of the element&#8217;s content. </p>

<p>For example, consider the following two  tags.</p>

<pre><code>&lt;div style="width:400px;border:solid 1px black"&gt;
First Box
&lt;/div&gt;

&lt;div style="width:400px;border:solid 1px black;padding:10px"&gt;
Second Box
&lt;/div&gt;
</code></pre>

<p>The two  elements are the same, except for the second  element&#8217;s additional padding. In Quirks mode (see Figure 2), the two  elements appear to be the same size, because the additional padding of the second  element is taken into account when calculating its width (the total width of both elements is 400px). In Standards mode (see Figure 3), the second  element appears wider than the first  element, because padding is not taken into account when calculating the width of an element (the total width of both elements is wider than 400px).</p>

<p>Figure 2. Quirks mode</p>

<p>Figure 3. Standards mode </p>

<p>This is only one example of browser differences in Quirks mode. In Quirks mode, each browser implements the W3C Cascading Style Sheet standards in significantly different ways. The beautiful thing about switching to Standards mode is that it forces almost all modern browsers to interpret the W3C standards in a very similar way (not exactly the same, but much better).</p>

<p>If you want your Web pages to appear in the same way across browsers, then it is a good idea to trigger Standards mode (in Internet Explorer and Opera) and Almost Standards mode (in Firefox), by including an XHTML 1.0 Transitional DOCTYPE.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jjgod</title>
		<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/comment-page-1/#comment-4525</link>
		<dc:creator>jjgod</dc:creator>
		<pubDate>Fri, 09 Dec 2005 08:47:58 +0000</pubDate>
		<guid isPermaLink="false">http://jjgod.3322.org/2004/11/14/mime-type-oyouaaana/#comment-4525</guid>
		<description>&lt;p&gt;您说的“如下方式”是什么？&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>您说的“如下方式”是什么？</p>]]></content:encoded>
	</item>
	<item>
		<title>By: jerry is cool</title>
		<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/comment-page-1/#comment-4508</link>
		<dc:creator>jerry is cool</dc:creator>
		<pubDate>Wed, 07 Dec 2005 01:55:04 +0000</pubDate>
		<guid isPermaLink="false">http://jjgod.3322.org/2004/11/14/mime-type-oyouaaana/#comment-4508</guid>
		<description>&lt;p&gt;很有启发。
我对以下问题非常困惑，能否解释firefox不支持 在XHTML中的如下方式：&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>很有启发。
我对以下问题非常困惑，能否解释firefox不支持 在XHTML中的如下方式：</p>]]></content:encoded>
	</item>
	<item>
		<title>By: nina</title>
		<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/comment-page-1/#comment-3380</link>
		<dc:creator>nina</dc:creator>
		<pubDate>Thu, 07 Apr 2005 03:17:39 +0000</pubDate>
		<guid isPermaLink="false">http://jjgod.3322.org/2004/11/14/mime-type-oyouaaana/#comment-3380</guid>
		<description>&lt;p&gt;找mime type很痛苦~&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>找mime type很痛苦~</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Neo</title>
		<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/comment-page-1/#comment-1239</link>
		<dc:creator>Neo</dc:creator>
		<pubDate>Fri, 14 Jan 2005 04:46:58 +0000</pubDate>
		<guid isPermaLink="false">http://jjgod.3322.org/2004/11/14/mime-type-oyouaaana/#comment-1239</guid>
		<description>&lt;p&gt;我早就关注这个问题，你的论述是我有了进一步的分析。&lt;/p&gt;

&lt;p&gt;对于使用了XHTML而导致document.write不工作的原因，我翻译了Ian Hickson的一篇文章：为什么document.write在XML中不工作 http://neoone.51.net/tech/dw_not_work.php&lt;/p&gt;

&lt;p&gt;有一些用户需要在XHTML中用到Google AdSense，也就是需要使用document.write，这里是一个基于PHP的解决方案：使Google广告AdSense在XHTML中工作  http://neoone.51.net/tech/adsense.php&lt;/p&gt;

&lt;p&gt;为不同的浏览器使用不同的MIME Type：使用正确的MIME类型伺服XHTML  http://neoone.51.net/tech/mime_type.php&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>我早就关注这个问题，你的论述是我有了进一步的分析。</p>

<p>对于使用了XHTML而导致document.write不工作的原因，我翻译了Ian Hickson的一篇文章：为什么document.write在XML中不工作 <a href="http://neoone.51.net/tech/dw_not_work.php" rel="nofollow">http://neoone.51.net/tech/dw_not_work.php</a></p>

<p>有一些用户需要在XHTML中用到Google AdSense，也就是需要使用document.write，这里是一个基于PHP的解决方案：使Google广告AdSense在XHTML中工作  <a href="http://neoone.51.net/tech/adsense.php" rel="nofollow">http://neoone.51.net/tech/adsense.php</a></p>

<p>为不同的浏览器使用不同的MIME Type：使用正确的MIME类型伺服XHTML  <a href="http://neoone.51.net/tech/mime_type.php" rel="nofollow">http://neoone.51.net/tech/mime_type.php</a></p>]]></content:encoded>
	</item>
	<item>
		<title>By: birdshome</title>
		<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/comment-page-1/#comment-118</link>
		<dc:creator>birdshome</dc:creator>
		<pubDate>Tue, 30 Nov 2004 06:28:38 +0000</pubDate>
		<guid isPermaLink="false">http://jjgod.3322.org/2004/11/14/mime-type-oyouaaana/#comment-118</guid>
		<description>&lt;p&gt;当深入web开发，特别是对表现层很关注的时候，我越发觉得凌乱的html就是bull shit.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>当深入web开发，特别是对表现层很关注的时候，我越发觉得凌乱的html就是bull shit.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: andty</title>
		<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/comment-page-1/#comment-86</link>
		<dc:creator>andty</dc:creator>
		<pubDate>Sun, 21 Nov 2004 11:20:11 +0000</pubDate>
		<guid isPermaLink="false">http://jjgod.3322.org/2004/11/14/mime-type-oyouaaana/#comment-86</guid>
		<description>&lt;p&gt;有同感...
不过,我菜鸟,能否支持支持我...我要解析http的头,处理一些东西....&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>有同感&#8230;
不过,我菜鸟,能否支持支持我&#8230;我要解析http的头,处理一些东西&#8230;.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: x5</title>
		<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/comment-page-1/#comment-69</link>
		<dc:creator>x5</dc:creator>
		<pubDate>Sun, 14 Nov 2004 03:39:32 +0000</pubDate>
		<guid isPermaLink="false">http://jjgod.3322.org/2004/11/14/mime-type-oyouaaana/#comment-69</guid>
		<description>&lt;p&gt;说的好~~发现你的文笔真不错~~~
读完，感觉你像个烈士~~~&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>说的好~~发现你的文笔真不错~~~
读完，感觉你像个烈士~~~</p>]]></content:encoded>
	</item>
	<item>
		<title>By: guoshuang</title>
		<link>http://blog.jjgod.org/2004/11/14/mime-type-oyouaaana/comment-page-1/#comment-68</link>
		<dc:creator>guoshuang</dc:creator>
		<pubDate>Sun, 14 Nov 2004 02:09:10 +0000</pubDate>
		<guid isPermaLink="false">http://jjgod.3322.org/2004/11/14/mime-type-oyouaaana/#comment-68</guid>
		<description>&lt;p&gt;So good article!I like it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>So good article!I like it.</p>]]></content:encoded>
	</item>
</channel>
</rss>

