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

176
Views
El lienzo dentro del iframe no se puede usar desde el padre

¿Cómo uso un lienzo dentro de un iframe en espacio aislado del padre y del mismo origen? Por ejemplo:

HTML:

 <iframe id="myIframe" sandbox="allow-forms allow-same-origin" srcDoc='<canvas id="myCanvas" width="200" height="100" style="border:1px solid #d3d3d3;display: block"></canvas>'

JS:

 var iframeDocument = document.getElementById("myIframe").contentDocument var c = iframeDocument.getElementById("myCanvas"); var ctx = c.getContext("2d"); ctx.moveTo(0,0); ctx.lineTo(200,100); ctx.stroke();

El código anterior simplemente no funcionaría, pero el código funciona en un lienzo normal, no dentro de un iframe.

about 4 years ago · Juan Pablo Isaza
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!