Bug fixing: window.location.origin for IE.