window.location is the correct way to access the URL information, and it's about 20% faster than document.location.