I'm new to JavaScript and jQuery, so I'm not even sure this is possible
I'm trying to run an AJAX request in which a search runs through an array of titles so that I can then later store other information that is returned for later use. Can I put a for loop inside the query parameter to achieve this? My code is below but it's not returning anything right now.
$.ajax('http://api.themoviedb.org/3/search/movie', {
type: 'GET',
dataType: 'jsonp',
data: {
api_key: myApiKey,
query: for (var i = 0; i < movies.length; i++) {
console.log(movies[i]);
},
success: function (result) {
console.log(result);
}
}); // end search ajax request