I would like to extract the base domain from the url in javascript. For example for the list of urls listed below I need to get google.com (or googl
(function (){ var d = document.domain.split('.'); var i = d.indexOf('google'); return d.slice(i).join('.'); })();