How i can get the domain name example.com
from the set of possible subdomains sub1.example.com
sub2.example.com
sub3.example.com
using javascript ...?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
This is faster
To get only the second-level-domain, you might use
The generic solution is explained here http://rossscrivener.co.uk/blog/javascript-get-domain-exclude-subdomain From above link