Some examples:
window.location.href: The full URL.
window.location.protocol: The protocol (e.g., http:, https:).
window.location.host: The host (e.g., www.example.com:8080).
window.location.hostname: The hostname (e.g., www.example.com).
window.location.port: The port number (e.g., 8080).
window.location.pathname: The path of the URL (e.g., /path/to/resource).
window.location.search: The query string (e.g., ?query=example).
window.location.hash: The fragment identifier (e.g., #section).
JS Shorts: [ Ссылка ]-
Ещё видео!