How can I get the domain without subdomain in JS without jQuery?
I saw a lot of solutions with split and regular expressions that doesn't work in all this cases:
- http:// subdomain.domain.com.br
- http:// subdomain.domaincom
- http:// www.domain.com
- http:// www.domain.com.br
The result may be: domain.com / domain.com.br