Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
HTML/Javascript: Capture Form Response

I'm trying to use the below snippet to capture the HTTP response of the form request and display the response in the browser. But clicking for Submit button navigates me away from my website.

<!DOCTYPE html>
<html lang="en">
   <head>
   </head>
   <body>
    <form name="responseHere" action="https://www.stackoverflow.com/">
      <input type="submit" value="Submit request" />
    </form>
      <script type="text/javascript">
            var responseHere = document.getElementById("responseHere").value;
            alert(responseHere)
      </script>
   </body>
</html>

I've also tried XHR methods to perform GET requests, but receive a CORS error when attempting to query domains outside my website's domain.

Is it possible to capture the HTTP response from the form submission and pass it to alert() or console.log() in Javascript?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda