I need to process URLs with JS and find out if they belong to youtube.com, vimeo.com or none of them. How do I do that?
I found this question How to get Domain name from URL using jquery..?, but it keeps 'http://www.' part if it's included in the URL.
EDIT: People suggesting the indexOf solution: what if there's a youtube.com inside the URL path? Is this even possible? As in www.example.com/?article=why_youtube.com_is_the_best? This question Can . (period) be part of the path part of an URL? seems to indicate that this is a valid URL.