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

70
Visualizações
Jquery loop post requests

I have a question regarding jquery and javascript post request loop.

I am quite new to javascript, so i need help to creating a post loop.

I have this: User input field: x@x.com;y@y.com (the user can specify emails divided by semicolon.

Right now i have this:

<button id="sendwebhook">Send</button>
<script>
    $(document).ready(function() {
  $('#sendwebhook').click(function() {
    $.ajax({
      
url: "https://somesite.com/...",
      type: "POST",
      data: JSON.stringify(
        {  "email":"x@x.com" }
      ),
      complete: function(){     alert("Success")        }
    });
  });
});
    
</script>  

What i want to do is send a post request per email in the input field. So in this case i want to send this:

{  
"email":"x@x.com" 
},
{  
"email":"y@y.com" 
}

Or make two post requests with one json string. The user should be able to insert an unlimited amounth of emails, so i should be some kind of loop.

about 4 years ago · Juan Pablo Isaza
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