diff options
Diffstat (limited to 'files/zh-tw/archive/mozilla/firefox')
| -rw-r--r-- | files/zh-tw/archive/mozilla/firefox/index.html | 8 | ||||
| -rw-r--r-- | files/zh-tw/archive/mozilla/firefox/using_microformats/index.html | 78 |
2 files changed, 86 insertions, 0 deletions
diff --git a/files/zh-tw/archive/mozilla/firefox/index.html b/files/zh-tw/archive/mozilla/firefox/index.html new file mode 100644 index 0000000000..c87802d82f --- /dev/null +++ b/files/zh-tw/archive/mozilla/firefox/index.html @@ -0,0 +1,8 @@ +--- +title: Firefox +slug: Archive/Mozilla/Firefox +translation_of: Archive/Mozilla/Firefox +--- +<p>In progress. Out-of-date information about the Firefox project.</p> + +<p>{{SubpagesWithSummaries}}</p> diff --git a/files/zh-tw/archive/mozilla/firefox/using_microformats/index.html b/files/zh-tw/archive/mozilla/firefox/using_microformats/index.html new file mode 100644 index 0000000000..6e7260a691 --- /dev/null +++ b/files/zh-tw/archive/mozilla/firefox/using_microformats/index.html @@ -0,0 +1,78 @@ +--- +title: Firefox 3 Using Microformat +slug: Archive/Mozilla/Firefox/Using_microformats +translation_of: Archive/Mozilla/Firefox/Using_microformats +--- +<p>Microfotmats 讓網站可以提供語意化的資料給瀏覽器,這是為了讓瀏覽器不需知道如何剖析(parse)文件就可以呈現網頁資訊的摘要。Firefox 3 實做了一個全域的 microformats 物件(global microformats object) 以提供 microformats 的存取。這個物件與其 API 簡化了尋找、讀取 microfotmats 的工作。</p> +<h3 id=".E8.BC.89.E5.85.A5_microformats_API" name=".E8.BC.89.E5.85.A5_microformats_API">載入 microformats API</h3> +<p>Microformats 物件是用 Firefox 3 新加入的 JavaScript script loader 建立的。要使用這個 API,你首先需要載入這個物件:</p> +<pre>Components.utils.import("resource://gre/modules/Microformats.js");</pre> +<p>一旦載入了這個 microformats API,你就可以使用列在這裡的方式來管理 microformats,詳見 <a class="external" href="http://developer.mozilla.org/en/docs/Parsing_microformats_in_JavaScript">Parsing microformats in JavaScript</a>。</p> +<h3 id=".E9.A0.90.E5.85.88.E5.AE.9A.E7.BE.A9.E5.A5.BD.E7.9A.84_microformats" name=".E9.A0.90.E5.85.88.E5.AE.9A.E7.BE.A9.E5.A5.BD.E7.9A.84_microformats">預先定義好的 microformats</h3> +<p>Firefox 3 實做了好幾種常見的 microformats,以下是其定義:</p> +<dl> + <dt> + adr</dt> + <dd> + 代表住址 (例如一條街或郵寄住址)。</dd> + <dt> + geo</dt> + <dd> + 代表使用緯度、經度表示的地理位置。</dd> + <dt> + hCard</dt> + <dd> + 代表個人的聯絡方式。</dd> + <dt> + hCalendar</dt> + <dd> + 代表行事曆上的一個約會。</dd> + <dt> + tag</dt> + <dd> + 用於新增標籤給其他 microformats。 + <h3 id=".E6.96.B9.E5.BC.8F" name=".E6.96.B9.E5.BC.8F">方式</h3> + <h4 id="add.28.29" name="add.28.29">add()</h4> + <p>新增一個 microformat 到一個 microformat module。</p> + <p class="note">如果指定的名稱和現存的 microformat 相同,這個原來存在的 microformat 會被新增的所取代。</p> + <pre>add(name, definition);</pre> + <h5 id="Parameters" name="Parameters">Parameters</h5> + <p> </p> + <dl> + <dt> + name</dt> + <dd> + 新增到 microformat module 的 microformat 名稱。</dd> + <dt> + definition</dt> + <dd> + 描述 microformat 的 JavaScript 結構,詳見 <a class="external" href="http://developer.mozilla.org/en/docs/Describing_microformats_in_JavaScript">Describing microformats in JavaScript</a></dd> + </dl> + <h4 id="count.28.29" name="count.28.29">count()</h4> + <p>計算文件中符合我們指定的類型的 microformats 的數量</p> + <pre>numMicroformats = Microformats.count(name, rootElement, recurseFrames)</pre> + <h5 id="Parameters_2" name="Parameters_2">Parameters</h5> + <p> </p> + <dl> + <dt> + name</dt> + <dd> + 要計算的 microformat 名稱。</dd> + <dt> + rootElement</dt> + <dd> + 可加可不加。代表由此開始搜尋的 DOM 元素,預設是 content.document (換句話說,也就是整份文件)。</dd> + <dt> + recurseFrames</dt> + <dd> + 可加可不加。如果是 true,搜尋時會連 child frames 一起搜尋,預設是 true</dd> + </dl> + <h5 id=".E5.9B.9E.E5.82.B3.E5.80.BC_.28Return_value.29" name=".E5.9B.9E.E5.82.B3.E5.80.BC_.28Return_value.29">回傳值 (Return value)</h5> + <p>是一個整數值,代表符合指定類型的 microformats 數量。</p> + <h4 id="debug.28.29" name="debug.28.29">debug()</h4> + <h4 id="get.28.29" name="get.28.29">get()</h4> + <h4 id="getNamesFromNode.28.29" name="getNamesFromNode.28.29">getNamesFromNode()</h4> + <h4 id="getParent.28.29" name="getParent.28.29">getParent()</h4> + <h4 id="isMicroformat.28.29" name="isMicroformat.28.29">isMicroformat()</h4> + </dd> +</dl> |
