I heard using document.location is not a good idea. window.location is better.
But document.URL performs a similar role.
var msg = '<p><b>page title: </b>'+document.title +'<br/>';
msg += '<b>page address: </b>'+document.URL +'<br />';
msg += '<b>page address: </b>'+window.location+'<br/>';
msg += '<b>last modified: </b>'+ document.lastModified + '</p>';
var el = document.getElementById('footer');
el.innerHTML = msg;
In my code, document.URL and window.location print out same address. Any differences between them? When should I use document.URL and when window.location ?