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

259
Views
¿Cómo puedo enviar un enlace a una matriz JS?

Tengo tres enlaces que expresan tres imágenes diferentes. Quiero enviar estos enlaces a una matriz y puedo mostrar mis imágenes en la pantalla. Cómo puedo hacer eso

Este es mi código JS, ¿es correcto? Muchas gracias.

 let cardsource = [ "<a href = 'https://bom.to/Qd87vw'> Card 1</a>", "<a href = 'https://bom.to/P21flg'>Card 2 </a>", "<a href = 'https://bom.to/dFwwNw'>Card 3 </a>", ]; for (var index = 0; index < cardsource.lengh; index++) { console.log(cardsource[index]); }

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

No presione la etiqueta dentro de la matriz, simplemente presione el enlace que le da directamente la imagen.

 let cardsource = ['https://bom.to/Qd87vw', 'https://bom.to/P21flg', 'https://bom.to/dFwwNw']; cardsource.map((item) => <img src={item}>)

Esto es solo para darle una visión lógica de lo que debe hacer en lugar de lo que ha hecho. Si está trabajando con .jsx, este código funcionaría.

about 4 years ago · Juan Pablo Isaza Report

0

Utilice la función insertAdjacentHTML. Referencia

 let cardsource = [ "<a href = 'https://bom.to/Qd87vw'> Card 1</a>", "<a href = 'https://bom.to/P21flg'>Card 2 </a>", "<a href = 'https://bom.to/dFwwNw'>Card 3 </a>", ]; cardsource.map(val => document.body.insertAdjacentHTML('beforeend', val));
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!