How to use fetch with async/await?
问题 I start by saying that I am not 100% sure this is the problem, I mean using await and async. This is the scenario: I run this when I first load the page, and works fine, I get the data : externalContent(url); function externalContent(url) { fetch(url) .then(res => res.json()) .then(data => { ...cool data... }); } But then I need to be able to click a button and re run that function with the fetch So I do $(".alm-filters--button").on("click", function() { externalContent(url); }); But when I