HTML DOM inputEncoding 屬性

Document 對象參考手冊 Document 對象

實例

顯示當前文檔的字元編碼:

document.inputEncoding;

輸出結果:

UTF-8


定義和用法

inputEncoding 屬性可返回文檔的編碼(在解析時)。

如果問的在內存中創建返回 null


流覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

除了 Opera流覽器,所有主流流覽器都支持 inputEncoding 屬性。

注意: Internet explorer 8 及更早IE 版本不支持該屬性。


語法

document.inputEncoding

技術細節

返回值: 字串,返回文檔編碼
DOM 版本 Core Level 3 Document Object


Document 對象參考手冊 Document 對象