JavaScript Reference/Javascript Objects/location
Содержание
"location" Example
<html>
<body>
<table id="myTable">
<tr>
<td>Row 1</td>
</tr>
<tr>
<td>Row 2</td>
</tr>
<tr><td>Row 3</td>
</tr>
</table>
<button onclick="myTable.style.fontWeight = "bold";">Bold</button>
<button onclick="location.reload();">Reload page</button>
</body>
</html>
"location" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |document window |
+----------------+--------------------------------------------------------------+
"location" JavaScript Methods
+----------------+--------------------------------------------------------------+
| JavaScript |assign reload |
| Methods |replace |
+----------------+--------------------------------------------------------------+
"location" JavaScript Properties
+----------------+--------------------------------------------------------------+
| JavaScript |hash host |
| Properties |hostname href |
| |pathname port |
| |protocol search |
+----------------+--------------------------------------------------------------+
"location" Syntax and Note
Note:
Basic information about the current site being visited.
Syntax:
objectName.location.memberName