I am having troubles getting json back from the wikipedia api. I am using the fetch api for the request. Can someone take a look at my code and tell me what is going on?
[Solution]
Removed onsubmit=“search()” from form and made an event listener on my search button as @camperextraordinaire stated. For the addEventListener second parameter I used an anonymous function and it handled a preventDefault so the page wouldn’t refresh.
function(e){ e.preventDefault; search(); }