anchor.diff:    
     // Add an event handler to call the onSuccess function when the POST call is successful
     req.on.readyStateChange.add((Event e) {
  -    if (req.readyState == XMLHttpRequest.DONE && (req.status == 200)) {
  -      DivElement div_loggin = query('#log_form');
  -      div_loggin.style.display = 'none';
  -      
  -      DivElement logged_user = query('#logged_user');
  -      logged_user.style.display = '';
  -      logged_user.text = user;
  -      
  -      DivElement div_loggout_button = query('#logout_button');
  -      div_loggout_button.style.display = '';
  -    } else {
  -      print(req.status);
  -      print("ERROR DE LOGIN!!!!");
  +    if (req.readyState == XMLHttpRequest.DONE) {
  +      if (req.status == 200) {
  +        DivElement div_loggin = query('#log_form');
  +        div_loggin.style.display = 'none';
  +        
  +        DivElement logged_user = query('#logged_user');
  +        logged_user.style.display = '';
  +        logged_user.text = user;
  +        
  +        DivElement div_loggout_button = query('#logout_button');
  +        div_loggout_button.style.display = '';
  +        DivElement error = query('#error');
  +        error.style.display = 'none';
  +      } 
  +      if (req.status == 401) {
  +         print("Error: User/password is incorrect");
  +         query('#error_text').text = "User/password is incorrect";
  +         DivElement error = query('#error');
  +         error.style.display = '';
  +      }
       }
     });
   
  
positive.code:   showJson(req);
  }
  
  // Function that shows the desired message in the corresponding element
  void showJson(XMLHttpRequest req) {
    var parsedJSON = JSON.parse(req.responseText)["result_json"];
    var currentConditions = parsedJSON["data"]["current_condition"][0];
    query('#observationTime').text = currentConditions["observation_time"];
    query('#description1').text = currentConditions["weatherDesc"][0]["value"];
  
negative.code:   
    DivElement div_query = query('#content');
    div_query.style.display = 'none';
    
    DivElement error = query('#error');
    error.style.display = 'none';
  }
  
  void newQuery(event) {
  