Well, as per your code typing “hi” in the search would give me this https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=hi&namespace=0&limit=15&profile=fuzzy&suggest=1&redirects=resolve&utf8=1&callback=
but your success function references $(data.query.search) and as following the link will show you, there is no key called query, just an array containing the search term and 3 arrays. one for titles of search results, one for descriptions of the results at the corresponding index number, and one for the link to the wikipedia article for the index number.
you basically want for each result
data[i] //link to wiki
I would change out the 2 .each functions for 1 for loop, (1 each might work too, but I’m not as familiar with it)
and then you will have to change for instance “this.title” to data[i].
…also you have to put your variables inside the function, you want to set what search is every time someone clicks, not just once on page load. same with url.
Hope thats enough to get you going.