<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="ARTICLE @ XOOPS powered by FeedCreator" -->
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xml:lang="zh-TW">
    <title>睡蓮‧池水間 :: 文章</title>
    <tagline>文章XML</tagline>
    <link rel="alternate" type="text/html" href="http://waterlily-lsl.com/modules/article/view.article.php/187/c2"/>
    <id>http://waterlily-lsl.com/modules/article/view.article.php/187/c2</id>
    <modified>2012-05-23T15:05:50+02:00</modified>
    <author>
        <name>waterlily at waterlily-lsl dot com</name>
    </author>
    <generator>ARTICLE @ XOOPS powered by FeedCreator</generator>
    <entry>
        <title>如何在 IE 中使用 HTML 5 元素</title>
        <link rel="alternate" type="text/html" href="http://waterlily-lsl.com/modules/article/view.article.php/187/c2"/>
        <created>2009-06-20T22:27:33+02:00</created>
        <issued>2009-06-20T22:27:33+02:00</issued>
        <modified>2009-06-20T22:27:33+02:00</modified>
        <id>http://waterlily-lsl.com/modules/article/view.article.php/187/c2</id>
        <author>
            <name>睡蓮</name>
        </author>
        <summary>類別: 語言集&lt;br /&gt;來源: (http://www.planabc.net/2009/06/13/how_to_use_html5_elements_in_ie/)Sjoerd Visscher 發現了一個簡潔的方法樣式在 IE 中作用到未知的元素上 —— 僅需 JS 創建此未知元素即可：&lt;br /&gt;&lt;div class=&quot;xoopsCode&quot;&gt;&lt;p class=&quot;cTitle&quot;&gt;&lt;img class=&quot;icon-l&quot; src=&quot;http://waterlily-lsl.com/themes/waterlilyLSL-GW/img/code-icon1.gif&quot; alt=&quot;&quot;/&gt;&lt;img class=&quot;icon-r&quot; src=&quot;http://waterlily-lsl.com/themes/waterlilyLSL-GW/img/code-icon2.gif&quot; alt=&quot;&quot;/&gt;&lt;/p&gt;&lt;pre&gt;
document.createElement(elementName)
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;同理（對於 IE 來說 HTML5 元素即是未知元素），該方法也可順延到 HTML5 的元素上（詳細見：&lt;a href=&quot;http://ejohn.org/&quot; rel=&quot;external&quot;&gt;John Resig&lt;/a&gt; 寫的 《&lt;a href=&quot;http://ejohn.org/blog/html5-shiv/&quot; rel=&quot;external&quot;&gt;HTML5 Shiv&lt;/a&gt;》 一文）：&lt;br /&gt;&lt;div class=&quot;xoopsCode&quot;&gt;&lt;p class=&quot;cTitle&quot;&gt;&lt;img class=&quot;icon-l&quot; src=&quot;http://waterlily-lsl.com/themes/waterlilyLSL-GW/img/code-icon1.gif&quot; alt=&quot;&quot;/&gt;&lt;img class=&quot;icon-r&quot; src=&quot;http://waterlily-lsl.com/themes/waterlilyLSL-GW/img/code-icon2.gif&quot; alt=&quot;&quot;/&gt;&lt;/p&gt;&lt;pre&gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;style&amp;gt;section { color: red; }&amp;lt;/style&amp;gt;
&amp;lt;script&amp;gt;document.createElement(&amp;quot;section&amp;quot;)&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;section&amp;gt;Hello World!&amp;lt;/section&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;在 IE 中，為了更方便使用 HTML5 元素，我們可以引入這樣的腳本：&lt;br /&gt;&lt;div class=&quot;xoopsCode&quot;&gt;&lt;p class=&quot;cTitle&quot;&gt;&lt;img class=&quot;icon-l&quot; src=&quot;http://waterlily-lsl.com/themes/waterlilyLSL-GW/img/code-icon1.gif&quot; alt=&quot;&quot;/&gt;&lt;img class=&quot;icon-r&quot; src=&quot;http://waterlily-lsl.com/themes/waterlilyLSL-GW/img/code-icon2.gif&quot; alt=&quot;&quot;/&gt;&lt;/p&gt;&lt;pre&gt;
(function(){
    // from: &lt;a href=&quot;http://dean.edwards.name/weblog/2007/03/sniff/&quot; title=&quot;http://dean.edwards.name/weblog/2007/03/sniff/&quot; rel=&quot;external&quot;&gt;http://dean.edwards.name/weblog/2007/03/sniff/&lt;/a&gt;
    if(!/*@cc_on!@*/0) return; 

    var html5 = &amp;quot;abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,figure,footer,hgroup,header,mark,menu,meter,nav,output,progress,section,time,video&amp;quot;.split(&amp;#039;,&amp;#039;);
    for(var i = 0, len = html5.length; i &amp;lt; len; i++ )
        document.createElement(html5[i]);
    }
})();
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;詳細具體應用的案例如下：&lt;br /&gt;　　《&lt;a href=&quot;http://www.fofronline.com/2009-06/moving-markup-towards-html5/&quot; rel=&quot;external&quot;&gt;Moving markup towards HTML5&lt;/a&gt;》&lt;br /&gt;　　《&lt;a href=&quot;http://www.brucelawson.co.uk/tests/html5-elements.html&quot; rel=&quot;external&quot;&gt;Test new HTML 5 elements&lt;/a&gt;》&lt;br /&gt;</summary>
    </entry>
</feed>

