小白教程
所有教程
关于
Search
172.70.179.69
172.70.179.69
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Prop document documenturi”的源代码
本页内容
上一节:
Prop_doc_documentmode
下一节:
Prop_doc_domain
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:document.documentURI}}[[Category:dom obj document|17]] = HTML DOM documentURI 属性 = [[dom obj document|Document 对象]] 获取文档本地URI: <sample title="" desc="" lang="html" hererun="1"> document.documentURI; </sample> 输出结果: <sample title="" desc="" lang="html" hererun="1"> http://www.w3cschool.cc/jsref/prop-document-documenturi.html </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.documentURI; } </script> <p><strong>注意:</strong>Internet Explorer不支持documentURI属性。</p> </body> </html> </run> == 定义和用法 == documentURI 属性可设置或返回文档的位置。 如果文档由 DocumentImplementation 对象创建, 或者如果它未定义,则返回 null。 == 浏览器支持 == 除了 Internet Explorer 浏览器,其他浏览器都支持 documentURI 属性。 == 语法 == 设置文档的 documentURI: <pre> document.documentURI=locationURI </pre> 返回 documentURI: <pre> document.documentURI</pre> == 技术细节 == {| class="table table-striped table-hover" | 返回值: | 字符串, 代表文档的URI。 |- | DOM 版本 | Core Level 3 Document Object |} [[dom obj document|Document 对象]]
返回至“
Prop document documenturi
”。
上一节:
Prop_doc_documentmode
下一节:
Prop_doc_domain