Where can I find reference code that implements a HTTP Basic Authentication client in pure JavaScript, suitable for AJAX?
Extra points for code, or pointers to code,
The five-parameter version of the XMLHttpRequest.open method allows you to specify the username and password. (WHATWG spec)
XMLHttpRequest.open
xhr.open(method, url, async, username, password)