Wikipedia Viewer get json data help

Edit: Now I found a get request/url that works, but it doesn’t work with on-click. The call goes through and returns a log, but once I add it to the on-click function, it doesn’t go through anymore. How do I get the search term into it once I get the search term. I know the code for the search term and have gotten it and the url, but haven’t been able to make a call with it.