how to refer a new document after a location replace in javascript code example Example: js change url window.location.href = "www.google.com";