get specific data after a POST

Hi, I need help with this.
I have this code:

var valueUsername = $$("usernameTextBox").getValue().toString();
var valuePassword = $$("passwordTextBox").getValue();
webix.storage.local.put("state", $$("businessComboBox").getValue());
var state = webix.storage.local.get("state");
console.log(valueUsername + " " + valuePassword);
webix.ajax().post("//172.16.1.5:3000/api/login", { usuario: valueUsername, password: valuePassword, codemp: state }).then(function (data) {
//response text
if (data.success == true) {
webix.$$('main').show();
webix.$$('toolbar').show();
$$("businessComboBox").refresh();
console.log(state);
} else {
webix.message("Usuario o contraseña inválidos");
}
console.log(data.text());
});

What I want is to get a specific data after a POST because i need the value of "success" to know if the data that the user provide is correct let it continue with the web page.

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion