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

219
Vistas
JS - dates in array, link building

I'm looking for a way to add a working link to the eventName. If I add a link directly in the code, it will be displayed as text, not as link. Do I have to write a completely new function here or is somewhere simple trick enough? I will be grateful for your response.

!function () {
    var data = [
        {eventName: '<a href="#">EventName</a>', calendar: 'Work', color: 'orange', eventTime: moment("2021-12-22")},
        {eventName: '<a href="#">EventName</a>', calendar: 'Work', color: 'orange', eventTime: moment("2021-12-02")},
        {eventName: '<a href="#">EventName</a>', calendar: 'Other', color: 'green', eventTime: moment("2021-12-09")}
    ];
about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You are creating the event as a span, so it just prints out the anchor tag as text

On your Calendar.prototype.renderEvents function, you should create an anchor tag and set its href

var a = createElement("a", "", ev.eventName);
a.href = "#";

Instead of

var span = createElement("span", "", ev.eventName);
about 4 years ago · Santiago Trujillo Denunciar

0

Right around line 303 you have this:

  var span = createElement('span', '', ev.eventName);

The default behavior of that 3rd argument is to set it's content as text element. You can force it to render the content as HTML with this additional line.

  var span = createElement('span', '');
  span.innerHTML= ev.eventName;

Example: https://codepen.io/javacado/pen/bGoogYg?editors=1111

about 4 years ago · Santiago Trujillo 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