小白教程
所有教程
关于
Search
108.162.216.242
108.162.216.242
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Prop document inputencoding”的源代码
本页内容
上一节:
Met_document_importnode
下一节:
Prop_doc_lastmodified
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:document.inputEncoding}}[[Category:dom obj document|28]] = HTML DOM inputEncoding 属性 = [[dom obj document|Document 对象]] 显示当前文档的字符编码: <sample title="" desc="" lang="html" hererun="1"> document.inputEncoding; </sample> 输出结果: <sample title="" desc="" lang="html" hererun="1"> UTF-8 </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> </head> <body> <p id="demo">单击按钮确认文档的编码方式</p> <button onclick="myFunction()">点我</button> <script> function myFunction(){ var x=document.getElementById("demo"); x.innerHTML=document.inputEncoding; } </script> <p><strong>注意:</strong>Opera、Internet explorer 8及早前版本不支持inputEncoding属性。 </p> </body> </html> </run> == 定义和用法 == inputEncoding 属性可返回文档的编码(在解析时)。 如果问的在内存中创建返回 null 。 == 浏览器支持 == 除了 Opera浏览器,所有主流浏览器都支持 inputEncoding 属性。 '''注意:''' Internet explorer 8 及更早IE 版本不支持该属性。 == 语法 == <pre> document.inputEncoding</pre> == 技术细节 == {| class="table table-striped table-hover" | 返回值: | 字符串,返回文档编码 |- | DOM 版本 | Core Level 3 Document Object |} [[dom obj document|Document 对象]]
返回至“
Prop document inputencoding
”。
上一节:
Met_document_importnode
下一节:
Prop_doc_lastmodified