Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
How do I use a website service to return values into HTML

I am trying to use a service that runs on my company website in order to grab some information and use it to populate a field in a form.

I have the service URL https://www.test.co.uk/service/17186914/17186914 where the 2 codes are product SKU's. When this services runs it shows a JSON file which contains the Product price. I want to be able to grab this price in order to populate a hidden field on a form I am creating.

Is this possible?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Here is an example of how to fetch json data from a url and display it in an input field.

const url = 'https://jsonplaceholder.typicode.com/todos/1';
fetch(url).then(res => res.json()).then(data => {
  const inputElem = document.querySelector('input');
  inputElem.setAttribute('value', data.title);
  console.log(data);
});
<input />

about 4 years ago · Juan Pablo Isaza Relatório

0

I roughly understood what are you trying to do.

      const newVariableThatyouNeed = JSON.parse(yourData);

Note that yourData come from the reducer (if you use redux) or the result of your API. And add a new cons with whatever name you want.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda