let fieldName = "" let jsonResponse = "" let collectionName = "" let fieldEl = document.getElementById("field_el") let inputEl = document.getElementById("input-el") let buttonEl = document.getElementById("button-el") let collectionData = { averagePrice: "" } const getStatsAvgPrice = { currentAP: function() { collectionData.averagePrice = jsonResponse.stats["average_price"] } } function callApi(collectionName,fieldName) { fetch(`https://api.opensea.io/api/v1/collection/${collectionName}/${fieldName}`) .then(response => response.json()) .then(response => jsonResponse = response) .then(getStatsAvgPrice.currentAP()) .then(render()) .catch(err => console.error(err)); } function render() { document.getElementById("report").innerHTML = JSON.stringify(collectionData.averagePrice); console.log(JSON.stringify(collectionData.averagePrice)) } buttonEl.addEventListener("click", () => { collectionName = inputEl.value fieldName = fieldEl.value callApi(collectionName,fieldName) })¿Cómo puedo hacer que esto funcione? ¿Quizás hacer más funciones? Agregar al dom? Cualquier idea sería útil. Sigo recibiendo un error de doble clic a pesar de que el flujo es correcto.