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 8327091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:59:15+00:00 2026-06-09T00:59:15+00:00

This is a follow up to this question: Invoking javascript in iframe from parent

  • 0

This is a follow up to this question: Invoking javascript in iframe from parent page

I’ve implemented the answer provided by @Tomalak.

Here is a jsFiddle

The problem is this, the content in the iframe is dynamically created (so no cross domain issues). Within the content is a button whose onclick event handler calls window.print(). This prints only the content of the iframe(which is good and is serving as proof of concept).

Additionally, there is a button on the parent page which calls a public function published by the iframe. The function is printContent, and like the iframe button’s onclick event handler, it also calls window.print().

This is the issue, when printing from the button on the parent page using IE 8, the content of the parent page also prints. (This does not happen with Chrome.)

Is there a fix which makes IE 8 print only the content of the iframe?

Interestingly enough, returning window.document.title via a public function, does return the title of the iframe content, even when using IE 8.

The fiddle demonstrates the problem and offers more detail.

  • 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-06-09T00:59:17+00:00Added an answer on June 9, 2026 at 12:59 am

    In IE you need to set focus to the window you want to print. This prints iframe when function is in parent page:

    function printContent(){
        var el = document.getElementById('myFrame');
        el.contentWindow.focus();
        el.contentWindow.print();
        return;
    }
    

    If function is in the iframe, you can print it from anywhere:

    function printContent(){
        window.focus();
        window.print();
        return;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow up question from here specifically concerning its answer . From
This is a follow-on question from the one I asked here . Can constraints
This is a follow up question from here . Where I want do go
This is a follow up question from my previous one found here I need
This is a follow up question to the one answered here: Excluding dates from
This is a follow up question from here . I have some output and
This is a follow up question from Calling constructor in return statement . This
This is a follow-up question to ASP.NET How to pass container value as javascript
This is a follow up question from Problem with array assignment I now have
This is a follow up question from Grammar: difference between a top down and

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.