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

470
Vistas
Appending date to HTML Redirect URL using Variable

Looking to append yesterdays date to a URL in a meta html redirect. The goal would be something that works like this.

<meta http-equiv="Refresh" content="5; url=https://cse.google.com/cse?cx=xxx&q="news" after:%yesterdaydate%"/>

Would this be possible with Javascript or HTML?

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

0

Quite simply.

After creating a Date, create a date string for yesterday's date.

Set the <meta> tag - page will redirect to that URL.

NOTE: It would be prudent to do this by creating the <meta> tag programmatically rather than using innerHTML, but this will work to demonstrate how it is done.

const date = new Date();
const dateString = new Date(date.setDate(date.getDate()-1)).toLocaleDateString();
const meta = `<meta http-equiv="Refresh" content="5; url=https://cse.google.com/cse?cx=xxx&q=news after:${dateString}"/>`;
document.querySelector('head').innerHTML += meta;
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