I am trying to add the search string to the api end point and attach it to the call back function.
var searchString;
$("document").ready(function(){
$.get(
"https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=" + searchString +"&namespace=0&limit=10&origin=*", function (obj) {
console.log(obj);
// console.log(obj[1]);
}
);
});
searchString = function getString(paramtext) {
console.log(searchString);
return paramtext;
}