SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    strange problem while printing

    Hello.

    I have a html page containing a flash object.
    This page is called and printed onclick a button.

    The html page opens in a new window and pops up the print dialog.Whne i give the print it prints without the flash object shopwing.
    Whne i release the rpint again it prints fine.
    On cliking anywhere on the html page(i.e. activating the page ) and then releasing the print , it prints fine.
    Its just that as soon as the dialog pops up , if you release the print , it prints nothing.

    Is teher a way that I can activate the page on opening.

    Please help.
    Thanks.

  2. #2
    SitePoint Member CybJunior's Avatar
    Join Date
    Dec 2005
    Location
    fgfg
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how about window.onload?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    window.onload

    I tried using window.onload=init; after opening the html page to be printed..

    in the .js file tehre is a single fiunction init()


    <script defer src="onload.js" type="text/javascript">

    This gives me an error.

    Am I using teh onload wrongs.

    Thanks for the time..

  4. #4
    SitePoint Member CybJunior's Avatar
    Join Date
    Dec 2005
    Location
    fgfg
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <html>
    <head>
    <title>Untitled</title>
    <script type="text/javascript" language="javascript">
    function sayHi(){
        alert("Hello World!");
    }
    </script>
    </head>
    <body onload="sayHi();">
      
    </body>
    </html>
    This works fine...

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks - how do I incorporate here

    I have

    <body>
    <div>
    <input type=button name="cmdPring" value="Print Report" onClick="printdoc()">
    </div>
    </body>

    this calls a function in teh javascripts as

    function printdoc()
    {
    child=window.open('HOU/Data/GSC_Summary_Hou1.html');
    window.focus(); //Hide the child as soon as it is opened.
    child.print(); //Print the child.
    child.close();
    }



    How can I call the onload function here..
    Thanks a zillion....
    kiran

  6. #6
    SitePoint Member CybJunior's Avatar
    Join Date
    Dec 2005
    Location
    fgfg
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <html>
    <head>
    <script type="text/javascript">
    function printdoc()
    {
    child=window.open('test.html');
    window.focus(); //Hide the child as soon as it is opened.
    child.print(); //Print the child.
    child.close();
    }
    
    </script>
    </head>
    <body onload="printdoc();">
    <div>
    
    </div>
    </body>
    </html>

    Tested, working...

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    yes thank you

    Thanks for teh help.

    Prints fine now.
    appreciate it.


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
  •