-
How do you Print a Partial Page?
-
How do you Show a Partial Page in New Window? Then User Prints.
Note: The partial page is in an IFrame.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You have some limitations when printing the contents of an IFrame. JavaScript security policies will prevent you from printing something if its in a different domain. This is the method I’ve used for years to print specific content on a page.
First you need a simple print function in JavaScript. This is the one I use
Then you need to pull the HTML from the iframe
Then a simple function to wrap the whole thing to make it easier
Once you have all that you can call the printIFrame method and simply send in the ID of the IFrame.
Method 2:
Open the Iframe in a new window and print that window.