SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2004
    Location
    austin
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy window.print(); in safari!?

    hi everybody.

    i'm trying to send a html page directly to the print preview and bypass opening it in a new window. i've found a good solution by having a frameset with 2 rows. the top row is relative while the bottom row is 1 pixel height (hidden at the bottom). the user clicks a print button in the main top frame and it loads the html page that needs to be printed in the bottom hidden frame. on the print file, i included:

    <body onload="window.print();">

    therefore, the code above initiates an instant print preview. the problem is that it doesn't work in safari (osx). instead of printing the specific frame that the page is in, it print the frameset at the _top of the browser window.i tried changing the location to this., parent.window, etc...but, none worked.

    is there a fix for this? or a better solution? i've been looking for a while and can't seem to find anything. help please! thanks!

  2. #2
    SitePoint Member
    Join Date
    Aug 2004
    Location
    austin
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any suggestions?

  3. #3
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about_:
    <body onload="window.focus();window.print();">

    Also here is a link to their developer site:
    http://developer.apple.com/internet/safari.html

  4. #4
    SitePoint Member
    Join Date
    Aug 2004
    Location
    austin
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the reply requestcode! didn't work, though... the print prompt didn't come up at all in safari when trying 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
  •