Fix window.location mistakes in previous code

Sorry guys, I commit the incomplete code. It should be window.location.assign(url);

However this is just tested in google chrome.