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

238
Views
I have used <iFrame> tag in my react app but it will open the same file even the file url is different, but if I used <a> tag it open perfectly

item.image URL is coming form the API but when I try to map in <a> tag it will work fine which is for the download icon but for the view icon it will open the same file. enter image description here

data.map(item => {
 return <>
     <Modal open={open} onClose={onCloseModal} center>
       <div className="modalContent">
           <iframe src={item?.image}>
           </iframe>      
       </div>
    </Modal>

 <a href={item?.image} target="_blank" download >
   <span className="IconBoc">
        <AiOutlineDownload />
    </span>
 </a>
</>
})

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

0

You should be using <img> instead of <iframe>.

iframes are to embed other websites into your website.

For media there already exist tags like <img> or <video>.

Try:

data.map(item => {
 return <>
     <Modal open={open} onClose={onCloseModal} center>
       <div className="modalContent">
           <img src={item?.image} />
       </div>
    </Modal>

 <a href={item?.image} target="_blank" download >
   <span className="IconBoc">
        <AiOutlineDownload />
    </span>
 </a>
</>
})
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!