Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

473
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!