Location.host : Location : Location JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Location » Location »

 

Location.host









The host property represents the host portion of the URL.

This is composed of the hostname and the port number (if available).

for example, www.navioo.com.












<html>
    <head>
    <title> Using the hash property of the Location object</title>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function show(){
         alert(document.location.host);
    }
    -->
    </script>
    <form name="form1">
    Click the button to get the current location.host value of the following address:
    <br>
    http://www.navioo.com
    <br><br>
    <input type="button" name="getLoc" value="Get host" onClick='show()'>
    <br>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Location
» Location