Do you know of a way to get the secondlevel domain of a website via javascript similar to document.location.hostname
?
I want to create a mailto bookmarklet that generates an email address from the string "info@" and the secondlevel domain. the issue with document.location.hostname is the "www." prefix.
Negative number can slice from the end, what gives the second level domain:
Quick and dirty...
But that's only going to strip off the first part. If you've got more than one level of server name, that's not going to work. By you should be able to figure it out.