问题
Similarly to how a <form>
with either no action
attribute or an empty one, is it consistent and reliable behaviour that an XMLHttpRequest with en empty string given to the URL parameter will request the current URL?
回答1:
After experimentation, it appears the answer is "No". In fact, the URL argument is required and will cause an error.
来源:https://stackoverflow.com/questions/12955019/default-url-for-xmlhttprequest