Timeline for Get protocol, domain, and port from URL
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 23, 2022 at 8:55 | history | edited | starball | CC BY-SA 4.0 |
denoise https://meta.stackexchange.com/q/131009/997587
|
Sep 16, 2019 at 14:41 | comment | added | A1rPun |
It looks like location.protocol is supported since may 2013. When this answer was made it made sense, for now you could use location.protocol .
|
|
May 22, 2017 at 10:49 | comment | added | Playdome.io | and how you'd do this on node? | |
May 16, 2017 at 19:35 | comment | added | Ryan McGeary |
Or just turn it into a one-liner: window.location.href.split('/').slice(0, 3).join('/')
|
|
Feb 18, 2016 at 0:02 | review | Suggested edits | |||
Feb 18, 2016 at 0:29 | |||||
Sep 10, 2015 at 5:07 | review | Suggested edits | |||
Sep 10, 2015 at 6:05 | |||||
Nov 26, 2014 at 6:03 | comment | added | Thamme Gowda |
This works with URL string where location object is not available(js outside browser!)
|
|
Aug 4, 2011 at 13:30 | vote | accept | yelo3 | ||
Aug 4, 2011 at 12:43 | history | answered | wezzy | CC BY-SA 3.0 |