Fixed location.origin issue for ie.