0

I need search through an API. Now I'm stuck with the search part.

movieArray = array with our API

apiTekst = the div where the API is going to be inside.

soeg = search-field

$("#apiTekst").ready(function(){
$("#soeg").keyup(function(){

    var searchWord = $("#soeg").val()
    console.log(searchWord);
    $(movieArray).each(function(){

        if ($(this).text().search(searchWord) !=  -1) {
            $(this).show();
        } else {
            $(this).fadeOut();
        }
    });
});
});

Problem: When I check the console it writes "Cannot read property 'defaultView' of undefined"

I have tried to solve it by changing all the "this" to MovieArray but it didn't help. I have also tried google without any luck.

EDIT: Found another solution!

K. Jeager
  • 1
  • 2

0 Answers0