JSFiddle - React, Tailwind, and code Playground
by Dong Nguyen
HTML
<div id="result"></div>
JavaScript
var url = 'http://api-itravel.linksie.com/accounts/login';
var el = document.getElementById('result');
var output = function(data){
var s = JSON.stringify(data);
el.innerHTML = s;
}
$.ajax(url, {
method: 'post',
dataType: 'json',
data: {
identification: '[email protected]',
password: 'asdasdda'
},
success: function(res){
res.case = 'success';
output(res);
},
error: function(res){
res.case = 'error';
output(res);
}
});