system PAUSE system PAUSE - 1 year ago 93
HTTP Question

Pure JavaScript code for HTTP Basic Authentication?

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, that can be used independent of JS toolkits like YUI. No points for Java, Flash/Flex, PHP frameworks, etc.

Answer Source

The five-parameter version of the method allows you to specify the username and password. (WHATWG spec), url, async, username, password)