Reputation: 3670
When I used the below script in www.example.com/about-us/user
, it showed entire url
<script type="text/javascript">
alert(document.URL);
</script>
I want to get only the domain name in here,say example.com
.. Is there any javascript inbuilt function for retrieving domain name?
Upvotes: 1
Views: 438