JSFiddle - React, Tailwind, and code Playground
by koff75
HTML
<input id="movie" type="text" /><button>Search</button>
JavaScript
$(function() {
var url = 'http://api.themoviedb.org/3/',
mode = 'search/movie',
input,
movieName,
key = '?api_key=55c83804a9c22aacddc75aa99cf9cf4b';
$('button').click(function() {
var input = $('#movie').val(),
movieName = encodeURI(input);
$.ajax({
url: url + mode + key + '&query='+movieName ,
dataType: 'jsonp',
success: function(data) {
console.log(data);
alert(success);
}
});
});
});