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

121
Vistas
Why does "?a=a" get added to the back of my URL on GET?

I use a post GET request with action="/sact/${searchp}/" in order to submit an user search query.

var searchp = search.querySelector("input.search-input").value;
// returns the normal value

document.body.innerHTML += `<form id="jsForm" action="/sact/${search}/" method="GET"><input type="hidden" name="a" value="a"></form>`;
document.getElementById("jsForm").submit();

This redirects here:

router.get('/sact/:where', async (req, res, next) => {
  res.render('search');
});

I can't figure out why /?a=a gets added to the back of the URL every time it gets submitted. How do I remove it?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

When you document.getElementById("jsForm").submit(); will send the form on the URL as query parameters because you are using method="GET"

The a=a is from this field <input type="hidden" name="a" value="a"> is hidden on the HTML but still will be send on the URL

if you want to "hide" you could use method="POST" won't be visible on the URL

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