window.document.location.host

use window.document.location.host for urls