How to get the page address without http(s):// ? Is there any method? Or just Trim ?

  • Already watched. The question remains the same - Alyoshka Lavrushka
  • @Sergey is sarcasm or solution? - Nick Volynkin

2 answers 2

let location = window.location; location.host + location.pathname + location.hash let location = window.location; location.host + location.pathname + location.hash ?

    You can cut off with a regular expression:

     url = "https://ru.stackoverflow.com"; url = url.replace(/^https?\:\/\//i, "");