Wikipedia viewer weird problem

Wikipedia viewer weird problem
0

#1

i call a function when user click "ENTER’ and also the search button.When pressing AJAX response is fine.
But When clicking the search button it shows an error in my AJAX call.kinda seems weird.
A link to my codepen


#2

Look at lines 8…10:

  $('.btn').click(function() {
    $('#search_box').val('');
  });

When you click any button you clear the search box, so your getData function gets called with an empty query.


#3

Thank you for the help buddy