M
marcroy.olsen
Hi List,
I'm a newbie javascritp haxer, but i'm tryning to make a AJAX app.
I have make the backend on a Apache server and usinging the apache
HTTP mod_auth_bacis(http://httpd.apache.org/docs/2.2/mod/
mod_auth_basic.html) over SSL to talk to my webservice.
This all works fin.
Then in my javascript I use the XMLHttpRequest to call the webservice
like this:
***************************************************************************************************
httpRequest = new XMLHttpRequest(); //only using mozilla
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState == 4 && httpRequest.status == 200) {
return httpRequest.responseXML;
}
else{
return "error"
}
}
httpRequest.open('GET', url, false, username, password);
httpRequest.send('');
***************************************************************************************************
This works if the password and usernam is right(from a input in the
javascript). But if the username or password is wrong the browser
promt me for at username and password.
How do I catch that so the browser don't ask for a username and
password. But presentes the login page again?
Best regards
Marc
I'm a newbie javascritp haxer, but i'm tryning to make a AJAX app.
I have make the backend on a Apache server and usinging the apache
HTTP mod_auth_bacis(http://httpd.apache.org/docs/2.2/mod/
mod_auth_basic.html) over SSL to talk to my webservice.
This all works fin.
Then in my javascript I use the XMLHttpRequest to call the webservice
like this:
***************************************************************************************************
httpRequest = new XMLHttpRequest(); //only using mozilla
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState == 4 && httpRequest.status == 200) {
return httpRequest.responseXML;
}
else{
return "error"
}
}
httpRequest.open('GET', url, false, username, password);
httpRequest.send('');
***************************************************************************************************
This works if the password and usernam is right(from a input in the
javascript). But if the username or password is wrong the browser
promt me for at username and password.
How do I catch that so the browser don't ask for a username and
password. But presentes the login page again?
Best regards
Marc