location.hostname();
<script language='JavaScript' type='text/JavaScript'> <!-- document.write(location.hostname); //--> </script>