w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: DOM 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).
| 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 |
| 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