Работа с Location - определение адреса документа

Нажмите, чтобы посмотреть характеристики этой страницы

hash  
host  
hostname  
href  
pathname  
port  
protocol  
search  

Скрипт

В разделе <head>:

function showLoc(){
thash.innerText = document.location.hash.toString();
thost.innerText = document.location.host.toString();
thostname.innerText = document.location.hostname.toString();
thref.innerText = document.location.href.toString();
tpathname.innerText = document.location.pathname.toString();
tport.innerText = document.location.port.toString();
tprotocol.innerText = document.location.protocol.toString();
tsearch.innerText = document.location.search.toString();
}