Use location.href to get the correct ajax url.