Results 1 to 5 of 5

Thread: Print with a popup

  1. #1
    Join Date
    Aug 2006
    Posts
    287

    Print with a popup

    Hello friends, If I have this code:

    HTML:
    <html>
    <head> <head>
    <script language= "JavaScript" > <script language= "JavaScript">
    function imprimir(id) print function (id)
    { (
    var envio = "imprimir.htm" + "?parte=" + id; var shipping = "imprimir.htm" + "? part =" + id;
    var ventana = window.open(envio,"_blank","left=0,top=0,width=300 ,height=300,toolbar=no,location=no,status=no,menub ar=no,resizable=no,scrollbars=1"); var window = window.open (shipping, "_blank", "left = 0, top = 0, width = 300 height = 300, toolbar = no, location = no, status = no, menubar = no, resizable = no, scrollbars = 1 ");
    } )
    </script> </ script>
    </head> </ head>
    <body> <body>
    <div class= "contenido" > <div class= "contenido">
    <div class= "menu" > <div class= "menu">
    <a href= "javascript <a href = "javascript :imprimir('print')" > Imprimir </a> : print ( 'print') "> Print </ a>
    </div> </ div>
    <div id= "print" > <div id= "print">
    <span> DIV A IMPRIMIR </span> <br> <span> DIV A PRINT </ span> <br>
    <span> DIV A IMPRIMIR </span> <br> <span> DIV A PRINT </ span> <br>
    <span> DIV A IMPRIMIR </span> <br> <span> DIV A PRINT </ span> <br>
    </div> </ div>
    </div> </ div>
    </body> </ body>
    </html> </ html>
    and imprimir.htm I have on my page:

    <% @ LANGUAGE = "JAVASCRIPT"%>
    <html> <html>
    <head> <head>
    </head> </ head>
    <body> <body>
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    </body> </ body>
    </html> </ html>
    I like to take that from me imprimir.htm only DIV I want to print?

    I know that this can be done easier, such as doing everything in the same print function, but other issues I need to pass the DIV to print another page, and from another page to retrieve the party that has the id PRINT .

    I understand it ?

    Well, thanks in advance for any help.
    Dimension 1100 (FMY032J) mini-tower
    2.53ghz Intel Pentium 4
    80 gig nfts HDD
    512 RAM
    Main circuit board: Dell 0CF458
    BIOS: Dell A00
    Display: Intel(R) 82865G Graphics Controller [Display adaptor]
    Multimedia: Sound MAX Integrated Digital Audio
    Windows XP Home SP2

  2. #2
    Join Date
    Nov 2005
    Posts
    1,323

    Re: Print with a popup

    With window.opener.document accessing the elements of the window that opened the popup, you can obtain data from a div with, for example, window.opener.document.getElementById ( "iddiv"). ErHTML inn and place it where you want to the popup.

  3. #3
    Join Date
    Aug 2006
    Posts
    287

    Re: Print with a popup

    Thanks, but that is when the popup that I am going to open a html?, That is what I mean is that the popup will have a page loaded, then from that popup, as the recovery of DIV another page?

    The same question demand in the example, can be done? Sorry but if the answer was no before you can understand.
    Dimension 1100 (FMY032J) mini-tower
    2.53ghz Intel Pentium 4
    80 gig nfts HDD
    512 RAM
    Main circuit board: Dell 0CF458
    BIOS: Dell A00
    Display: Intel(R) 82865G Graphics Controller [Display adaptor]
    Multimedia: Sound MAX Integrated Digital Audio
    Windows XP Home SP2

  4. #4
    Join Date
    Nov 2005
    Posts
    1,323

    Re: Print with a popup

    Yes, it is possible, even if the popup has a page loaded, you can recover within a div or other item which is in the window that opened (window.opener.document).

  5. #5
    Join Date
    Aug 2006
    Posts
    287

    Re: Print with a popup

    Thanks absolute55, It worked perfectly, I never knew this could be done without the use for nothing or database programming. Thank you very much.
    Dimension 1100 (FMY032J) mini-tower
    2.53ghz Intel Pentium 4
    80 gig nfts HDD
    512 RAM
    Main circuit board: Dell 0CF458
    BIOS: Dell A00
    Display: Intel(R) 82865G Graphics Controller [Display adaptor]
    Multimedia: Sound MAX Integrated Digital Audio
    Windows XP Home SP2

Similar Threads

  1. Replies: 6
    Last Post: 11-08-2010, 12:33 PM
  2. Replies: 3
    Last Post: 28-07-2010, 10:19 PM
  3. Replies: 8
    Last Post: 09-11-2009, 07:14 AM
  4. Replies: 6
    Last Post: 30-05-2008, 10:53 PM
  5. Print spooler hangs when trying to print from a shared print
    By Jisbomb in forum Windows XP Support
    Replies: 3
    Last Post: 27-07-2007, 10:17 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,897,971.06362 seconds with 17 queries