Help with printing in popup

Discussion in 'JavaScript' started by suami, Nov 2, 2008.

  1. #1
    Hello,

    I'm trying to open a popup window to write text to this window,to print it and then in the next loop to write over on he same popup window a new text and to print the new one.

    Can anyone help me with it?

    this is what I do:

    var popup =window.open('','popup','toolbar=no,menubar=no,width=200,height=150');
    popup.document.open();

    for(i=0;i < counter;i++){

    popup.document.write("<html><head>");
    popup.document.write("<link type='text/css' media='print' rel='stylesheet' href='/css/print_modules.css' />");

    popup.document.write("</head><body onload='print()'>");
    popup.document.write(invoice_text);
    popup.document.write("</body></html>");
    popup.document.close();

    thanks in advance!
     
    suami, Nov 2, 2008 IP