Разбор URL
Разберём адрес http://realadmin.ru/saytostroy/?page=4#top
document.location.href http://realadmin.ru/saytostroy/?page=4#top
document.location.protocol http:
document.location.host realadmin.ru
document.location.pathname /saytostroy/
document.location.search ?page=4
document.location.hash #top