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

118
Views
HTML pdf not showing in safari

i have a php page which shows a list of invoices. clicking on any of those invoices shows its pdf file. When the user clicks on any invoice, the src of the embed tag is changed by jQuery to the appropriate pdf file.

Works very well, but strangely enough it behaves differently in safari then in firefox for instance.

In firefox i can just click on an invoice -> the pdf shows. if i right after that click on another invoice and after that click on the first invoice again -> the pdf shows again.

Safari: If i re-click an invoice, i get a blank pdf (embed tag). And downloading of that pdf results in a 0kb file.

Seems to only happen in safari.

Has anyone encountered this before and maybe know a solution to this issue? i have googled and tried a lot but it's still not working.

Html:
     <div class="card-body">
           <embed id="invoice_scan" src="" type="application/pdf" width="100%" height="400px" />
     </div>


jQuery:
     $('#invoice_scan').attr('src', '/docs/pdf_file1.pdf );
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I had this issue showing a pdf in an object tag using angular. The fix was to remove type="application/pdf" from the object tag.

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!