JSFiddle - React, Tailwind, and code Playground
by Alexey Zuev
HTML
<div id="result"></div>
<button id="get-data">Получить данные</button>
JavaScript
$(function() {
$(document).on('click', '#get-data', function() {
checkTranslit()
.done(function(result) {
$('#result').html(JSON.stringify(result));
})
.fail(function() {
});
});
function checkTranslit(translit){
var root = 'http://jsonplaceholder.typicode.com';
return $.ajax({
url: root + '/posts/1',
method: 'GET'
});
}
});