Javascript Reference
Categories: document

javascript document charset

@March 15, 2008, 1:22 a.m.
charset Firefox/Netscape/NN n/a IE 4 Chrome/Safari/DOM n/a

Read/Write

Indicates the character encoding of the document's content. This property is dropped from IE 6 for Windows in favor of the document.defaultCharset property. For Netscape 6, use the document.characterSet property.

 
Example
 
if (document.charset == "csISO5427Cyrillic") {
    // process for Cyrillic charset
}
 
Value

Case-insensitive alias from the character set registry (ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets).

 
Default

Determined by browser.


Powered by Linode.