<!doctype html>
<html>
<head>
<title>
GET PARTS OF URL OF WEBPAGE
</title>
</head>
<body>
<script>
document.write("The hostname is: ", window.location.hostname+"<br/>");
document.write("The pathname is: ", window.location.pathname+"<br/>");
document.write("Port is: ", window.location.port +"<br/>");
document.write("Host is: ", window.location.host +"<br/>");
document.write("Protocol is: ", window.location.protocol +"<br/>");
</script>
</body>
</html>