0
Как использовать запрос Ajax GET с пользователем Аутентификация с помощью алгоритма хеширования MD-5?Как использовать запрос Ajax с аутентификацией пользователя?
Как использовать запрос Ajax GET с пользователем Аутентификация с помощью алгоритма хеширования MD-5?Как использовать запрос Ajax с аутентификацией пользователя?
<script type="text/javascript">
function sendRequest(username, password)
{
var url = "http://ajaxref.com/ch7/protectedhash.php";
var options = { method: "GET",
username : username,
password : AjaxTCR.data.encodeMD5(password),
onSuccess : showResponse,
onFail : showFail};
AjaxTCR.comm.sendRequest(url,options);
}
function showFail(response, message)
{
var responseOutput = document.getElementById("responseOutput");
responseOutput.innerHTML = "<h3>Error:</h3>" + message;
}
function showResponse(response)
{
var responseOutput = document.getElementById("responseOutput");
responseOutput.innerHTML = response.xhr.responseText;
//document.location = "http://ajaxref.com/ch7/protectedhash/myprotectedpage.php";
}
window.onload = function()
{
document.requestForm.requestButton.onclick = function() { sendRequest(this.form.txtUser.value, this.form.txtPass.value); };
};
</scr
это то, что я сделал, но не работал? –
Я голосую, чтобы закрыть этот вопрос не по теме, потому что он не показывает каких-либо усилий на всех. – Rob