Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    88
    Thanks
    12
    Thanked 0 Times in 0 Posts

    open a new window and print it problem

    I am using this function to open a window and print the contents of the file.:

    Code:
    function printit()
    {
    	var a = window.open('draft.php','draft','width=550,height=600');
    	a.print();
    }

    The window opens fine and opens the print window but returns a print error saying 'the page was replaced while trying to print' when I click print. Any ideas?
    Last edited by beedie; 06-23-2008 at 12:30 PM.

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    I've not attempted to do window opening and printing before, but I'm wondering if your problem might be that your new window isn't yet loaded when the print command tries to execute.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •