I'm trying to render a PDF in my web page from another domain.
The html is:
<div id="pdfContainer">
<embed id="pdf" type="application/pdf" />
</div>
And the javascript:
$.get("http://otherDomain/Files/Pdf/some.pdf", function(data) {
$("#pdf").prop("src", data);
});
But of course I have a cross domain error. Is there a way to do it? With PHP maybe?
Thanks.
If you change the
scr
-attribute of an<embed>
-tag, it will really change the attribute, but it won't change the embedded object itself. I think the only ways to change or to make an already embedded object visible are:Demo
Try before buy