There are already answers which describes about window.location.href property and window.open() method.
I will go by Objective use:
Use window.location.href. Set href property to the href of another page.
Use window.open(). Pass parameters as per your goal.
Use window.location.href. Get value of window.location.href property. You can also get specific protocol, hostname, hashstring from window.location object.
See Location Object for more information.