As far as I've tested, these two methods work, but I don't know which one is the best, or the differences between them, and that's what I'd like to know.
Here are the two methods:
window.location = 'http://www.google.com';
window.location.assign = 'http://www.google.com';