Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1044437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:49:44+00:00 2026-05-16T15:49:44+00:00

I get ‘parent.iframePDF is undefined’ JavaScript error when i use the below code in

  • 0

I get ‘parent.iframePDF is undefined’ JavaScript error when i use the below code in Firefox and an ‘object expected’ error in IE.

Can someone tell me what it is that i’m doing wrong? Thanks

function PrintFrame(xFile){
    parent.iframePDF.location.href = xFile;
    document.getElementById("spanMess").style.display = "block";

    parent.iframePDF.onload = new function() {
        setTimeout("parent.iframePDF.print();parent.document.getElementById('spanMess').style.display='none';",10000);
    }
}

<iframe id="iframePDF" src="about:blank" style="display:none"></iframe>

<input type="image" onclick="PrintFrame('525.pdf')" src="../../cms_res/DisneyChannel/playhouse/images/buttons/printer.png" />

<span id="spanMess" style="display:none;color:red;">
    <h3>Preparing Document For Print</h3>
</span>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:49:45+00:00Added an answer on May 16, 2026 at 3:49 pm

    You should use name=”iframePDF” instead of id=”iframePDF”.
    In that way, you can use window.iframePDF (-> window.frames.iframePDF).

    If you use document.getElementById(‘iframePDF’), then you can’t use .location.href on that.

    Edit: Tim is right, no parent is needed here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

.get() converts a jQuery object to a DOM element that Javascript can use without
I get Compiler Error C2248 when i try to compile the following code: #include
I get this error when trying to do spiriting with compass. Template::Error (can't convert
I get an Access is Denied error message when I use the strong name
Get an error that the activity vTestSession can not be started and may be
I get this error when I try to call $func('something') : if(($object instanceof MyObject)
I get the following error even when my JAVA_HOME is set correctly. C:\workspace-sts-2.8.0.RELEASE\JBClient\target>echo %JAVA_HOME%
I get this error while accessing a php script: W/System.err: Error reading from ./org/apache/harmony/awt/www/content/text/html.class
get current array position pointer while doing foreach $object->result_array() Hi, consider this, a case.
I get this error while installing cmake on my machine. Error: Target org.macports.configure returned:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.