当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > DOM Location 对象

HTML DOM
DOM Input Checkbox
DOM Input File 对象
DOM Input Hidden对象
DOM Input Password 对象
DOM Input Radio 对象
DOM Input Reset 对象
DOM Input Submit 对象
DOM Input Text 对象
DOM Link 对象
DOM Location 对象
DOM Meta 对象
DOM Navigator 对象
DOM 对象
DOM Option 对象
DOM Screen 对象
DOM Select 对象
DOM Style 对象
DOM Table 对象
DOM TableData 对象
DOM TableHeader 对象

HTML DOM 中的 DOM Location 对象


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 730 ::
收藏到网摘: n/a

Location 对象

The Location object is an object that can be accessed through the location property of the Window object.
Location对象可通过window对象的location属性访问到。

The Location object contains information about the current URL.
Location对象包含了当前URL的信息

举例: 将用户传送到新的地方/URL

IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).

Location 对象属性

Property
属性
Description
描述
IE F N W3C
hash Sets or returns the part of the href property that follows the hash sign (#)
设置或返回href属性中在#符号后面的内容
3 1 2  
host Sets or returns the hostname and port number of the location or URL
设置或返回URL或本地所在的域名以及端口号
3 1 2  
hostname Sets or returns the hostname of the location or URL
设置或返回本地或是URL所在的域名
3 1 2  
href Sets or returns the entire URL
设置或返回完整的URL
3 1 2  
pathname Sets or returns the file name or path specified by the location object
设置或返回由location对象指定的file名称或是路径
3 1 2  
port Sets or returns the port number associated with the URL
设置或返与URL有关的端口号
3 1 2  
protocol Sets or returns the protocol part of the URL
设置或返回URL部分所使用的协议
3 1 2  
search Sets or returns the part of the href property that follows the question mark (?)
设置或返回href属性里?号之后的内容
3 1 2  

Location 对象方法

Method
方法
Description
描述
IE F N W3C
assign("URL") Loads a new document
加载新的文档
4 1 2  
reload() Reloads the current document
重新载入当前文档
4 1 2  
replace("URL") Replaces the current document with the one specified
用一指定的文档来替换当前的文档
4 1 3  

评论 (0) All

登陆 | 还没注册?