Access is denied when trying to print a frame

I'm getting an access is denied error in Internet Explorer when trying to print a frame.
The reason I need to print the frame and not the window is because I wan't to trigger Adobe Readers print function instead of IEs.
The script works fine if the html file is started from a directory and not on a web server.

Below is the code, if you try to change src of the frame to an object on your on harddrive the script will work.

<SCRIPT LANGUAGE="javascript">
function PrintFrame()

<FRAME name="ContentFrame" SRC="" onLoad='javascript:setTimeout("PrintFrame()", 500)'>
<!-- Increase the Timeout amount if no printing occurs -->

Who is Participating?
ZvonkoConnect With a Mentor Systems architectCommented:
Why then do you not access it realtive to server root?

<FRAME name="ContentFrame" SRC="/images/test.pdf" onLoad='javascript:setTimeout("PrintFrame()", 500)'>

ZvonkoSystems architectCommented:
You cannot print a frame which is other internet domain then the window where your print command is comming from.
I suppose your window is NOT  * domain.

Also if it  would be the same domain, so far my test go, I did not succeed in telling the pdf to print the window.
I got always the empty print page where pdf document was embedded.

ZvonkoSystems architectCommented:
So the answer is: that cannot be done.
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

PCK1978Author Commented:
That's true, when my file resides in a directory where my web server can access it my scripts work correct .
this frame works perfect if my page is i.e.
<FRAME name="ContentFrame" SRC="" onLoad='javascript:setTimeout("PrintFrame()", 500)'>

Thx Zvonko
PCK1978Author Commented:
I used the server address because I tried different servers
ZvonkoSystems architectCommented:
Why the grading B???
All Courses

From novice to tech pro — start learning today.