DOMException: a frame with the source " http: // localhost: 8084 " was blocked from accessing a frame with a transverse beginning.
, , iframe pdf, src datauristring, blob.
:
- blob pdf (..: pdf.output('blob')..)
- blob URL (..: URL.createObjectURL(blobPDF))
, (http/data) :
:
document.getElementById('pdf-box')
, , :
document.getElementById('pdf-prueba')
Chrome :
function open(){
var pdf = new jsPDF('p', 'mm', [55, 5]);
var blobPDF = pdf.output('blob');
var blobUrl = URL.createObjectURL(blobPDF);
$('#pdf-prueba').attr("src", blobUrl).load(function(e){
document.getElementById('pdf-prueba').contentWindow.print();
});
}
<iframe id="pdf-prueba" name="pdf-box"></iframe>