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

151
Views
Cómo redirigir la página usando targetURL con mi selector de fechas

Estoy ajustando con el script de Twisty: uso de Jquery UI Datepicker para redirigir a la URL: cambie el valor de la URL según la fecha seleccionada

Estoy intentando que el usuario haga clic en una fecha que se redirigirá a una página según la fecha seleccionada.

Si el usuario hace clic el 18 de enero, debe redirigirse a datpicker.com/18-01-2022. Si se selecciona la fecha del 22 de marzo, debe ir a datpicker.com/22-03-2022.

Pero estoy recibiendo esta alerta: redireccionar a indefinido, sin importar cómo modifiqué el script. Por lo tanto, agradecería su ayuda. Gracias.

Selecciona una fecha:

 <script> $(function() { function getDayOfYear(n) { var s = new Date(n.getFullYear(), 0, 0); var d = (n - s) + ((s.getTimezoneOffset() - n.getTimezoneOffset()) * 60 * 1000); var oneDay = 1000 * 60 * 60 * 24; var day = "00" + Math.floor(d / oneDay); return day.substr(-3); } var targetUrl; $("#datepicker") .datepicker({ dateFormat: 'dd-mm-yy', onSelect: function(dateText) { datePicked = $.datepicker.parseDate('dd-mm-yy', dateText); dayPicked = getDayOfYear(datePicked); targetUrl = "https://datpicker.com/" + dayPicked; $(this).change(); } }) .change(function() { alert("Redirect to " + targetUrl); //window.location.href = targetUrl; }); }); </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

window.open('https://www.abdo-host.com', '_blank');

o

 var link = document.createElement("a"); link.href = 'https://www.abdo-host.com'; link.target = '_blank'; var event = new MouseEvent('click', { 'view': window, 'bubbles': false, 'cancelable': true }); link.dispatchEvent(event);
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!