printer page break and javascript iframe - help

Posted on 2005-03-17
Medium Priority
Last Modified: 2008-02-01
Hello Experts,
I am trying to achive the page break for printer using one of the methods previously metnioned. in the Q

But when I print the javascript it does not insert the page break please guide me.

   .breakhere {page-break-after:always}

<iframe name="backFrame" id="backFrame" height="0" width="0"></iframe>
                                                <input type=button value="Print" onClick="printMe(myGeneratedHTML)">

                                                      myGeneratedHTML='something<span class="breakhere"> &nbsp;</span>somethingagain'
                                                            function printMe(myGeneratedHTML) {

Question by:pinaldave
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 16

Expert Comment

ID: 13572820
try to use these 2 changes

your style should be

use div as opposed to span.
div is a block element, and page-break-before apply to block element, however I'm not sure span will work with it!
LVL 75

Accepted Solution

Michel Plungjan earned 2000 total points
ID: 13573013
Yes, you forgot to include the style...


myGeneratedHTML='something<h1 style="page-break-before:always">&nbsp;</h1>somethingagain'
LVL 21

Author Comment

ID: 13575136
thank you very much mplungjan...
That worked like magic.

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question