Get file server domain with Javascript or jQuery

I want to get plain domain without http(s)://www. (e.g. result of script is from the file link ( or

How I can do it with js or jquery?

Answers 1

  • This can be done with plain javascript.

    var url = new URL("");
    var hostname = url.hostname.replace("www.", "");

Related Articles