I want to ajaxify my Login page written in jsp. I already wrote the "verify_login" function which return a boolean value: either true or false.

Now the point is that I dunno how to retrieve this boolean value into my ajax script. I know nothing about Ajax, I just saw this code and im trying to do the same: http://woork.blogspot.com/2007/10/lo...x-and-php.html

In the following code, the result of the login page is a value of 0 if the login fails, or the function returns the username in the other case. In my case, I wanna test: if (response == false) ... how can I do it ? it's not working

function loginReply() {
if(http.readyState == 4){
var response = http.responseText;
if(response == 0){
// if login fails
document.getElementById('login_response').innerHTML = 'Login failed! Verify user and password';
// else if login is ok show a message: "Welcome + the user name".
} else {
document.getElementById('login_response').innerHTML = 'Welcome'+response;

Thank U in advance