From d1287dfd51096bfcd9d5208f411f1ac71c7d1103 Mon Sep 17 00:00:00 2001 From: pedromuniz378 Date: Mon, 9 Oct 2023 11:34:32 -0300 Subject: [PATCH] =?UTF-8?q?Altera=C3=A7=C3=B5es=20para=20aceitar=20code=20?= =?UTF-8?q?e=20state.=20(Vale=20para=20ML=20e=20Bling)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 5 +++-- scripts.js | 13 ++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 6cf7d8d..5872c75 100644 --- a/index.html +++ b/index.html @@ -8,8 +8,9 @@
-

Código gerado pelo Mercado Livre

-

+

Código gerado pela API

+

+

diff --git a/scripts.js b/scripts.js index ab655fb..c7d6012 100644 --- a/scripts.js +++ b/scripts.js @@ -1,11 +1,18 @@ function getParams() { let params = new URLSearchParams(location.search); - var paragraph = document.getElementById("p"); + console.log(params) + var code = document.getElementById("code"); if (params.get('code') != null) { - paragraph.textContent = params.get('code'); + code.textContent = params.get('code'); } else { - paragraph.textContent = 'Sem informações!'; + code.textContent = 'Sem informações!'; + } + var state = document.getElementById("state"); + if (params.get('state') != null) { + state.textContent = params.get('state'); + } else { + state.textContent = 'Sem informações!'; } }