Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js location

// https://example.com:81/path?argument=value#hash

location.href         // https://example.com:81/path?argument=value#hash
location.protocol     // https
location.hostname     // example.com
location.port         // 81
location.host         // example.com:81
location.pathname     // /path
location.search       // ?argument=value       (see URLSearchParams to parse)
location.hash         // #hash
location.origin       // https://example.com"
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #location
ADD COMMENT
Topic
Name
2+3 =