In the open() method of XMLHttpRequest, is an empty string for the url parameter valid? Assuming I want to POST a form on the current page to the same page, is:
var request = new XMLHttpRequest();
request.open('POST', '');
...effectively equivalent to:
var request = new XMLHttpRequest();
request.open('POST', window.location.href);
...? Is there any difference between using '' and window.location.href for the url parameter, in this case?
This answer says an empty string doesn't work, but doesn't explain why (and it does work through my own experimentation). I can't find a definitive answer in the documentation.