Using Wikipedia's API to fetch results from search query
<p>I am trying to use Wikipedia's API to make a search query, then append those results to my page. This is what I have so far : </p>

<pre><code> "use strict";
$(document).ready(function(){

function searchWikipedia(searchCriteria){
    $.getJSON('https://en.wikipedia.org/w/api.php?action=query&amp;format=json&amp;limit=15&amp;callback=?&amp;titles=' + searchCriteria, processResult);

}


$('#btn').click(function searchCriteria() {
    var searchCriteria = $("input[name=Wikipedia]").val();
    searchWikipedia(searchCriteria);

})

function processResult(apiResult){

  if (apiResult.query.pages[-1]){
       console.log("No results");
    } else {
       for (var i = 0; i &lt; apiResult.length; i++){
             $('#display-result').append('&lt;p&gt;'+apiResult+'&lt;/p&gt;');
       }
   }

}
}); 
</code></pre>

<p>So far nothing appends to my html and there's no errors in my console. </p>