So, I finally figured out how to get the data I need from the Wikipedia api, but whenever I try adding it to my page, it disappears. The input also disappears after you submit several times seemingly at random, but it seems more likely when you type in a longer search term,
Any help would be greatly appreciated!
In addition to what Randell points out, I would also add that you should be careful with your loops:
for(i=1; i<=data.length; i++){
for(j=0; j<= data[i].length; j++)
$(".one").html(data[i][j])
}
})
Your condition i<=data.length
will cause a fence posting error. If you array has 10 elements, then the highest index is 9 and these loops will try to access one past that. You want i<data.length
and j<data[i].length
.