JSFiddle - React, Tailwind, and code Playground

by Stepan Suvorov

JavaScript

function onDescription(description) {
    var content = $('').text(description);
    $('#results').append(content);
}

function onSearchResults(searchResults){
    $('#results').html('');
    $.each(searchResults, function(result){
        $.ajax({
            url: 'http://atlipedia.com/describe',
            dataType: 'json',
            data: result,
            success: onDescription
        });
    });
}

function onChange(){
    $.ajax({
        url:'http:://atloogle.com/search',
        dataType: 'json',
        data: $('#search').val(),
        success: onSearchResults
    });
}

$('#search').keydown(onChange);