用于HTTP基本身份验证的纯JavaScript代码? [英] Pure JavaScript code for HTTP Basic Authentication?
本文介绍了用于HTTP基本身份验证的纯JavaScript代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在哪里可以找到在纯JavaScript中实现HTTP基本身份验证客户端的参考代码,适用于AJAX?
Where can I find reference code that implements a HTTP Basic Authentication client in pure JavaScript, suitable for AJAX?
代码的额外点或代码指针,可以独立于YUI等JS工具包使用。 Java,Flash / Flex,PHP框架等没有要点。
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.
推荐答案
<$ c $的五参数版本c> XMLHttpRequest.open 方法允许您指定用户名和密码。 ( WHATWG规范)
The five-parameter version of the XMLHttpRequest.open
method allows you to specify the username and password. (WHATWG spec)
xhr.open(method, url, async, username, password)
这篇关于用于HTTP基本身份验证的纯JavaScript代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文