well, if you want to be safe to think that your page is compatible with all used browsers then you shouldn't force print. IE on mac doesn't support window.print();

you could just show the page and let them print it.

otherwise i'd say the iframe is your best bet ;)

-Jaimz

Jim Geurts wrote:
Sorry about that. I want to print a separate page when the user clicks a button/span, without navigating the user to that page.


On 5/9/06, *Jaimz* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    i'm kinda lost about what your trying to accomplish, if your
    trying to
    print a page's content in a printer friendly form you can use CSS
    for that.

    -Jaimz

    Jim Geurts wrote:
    > Does anyone know of a cross browser solution to print a page/url
    after
    > a user clicks a button?
    >
    > Currently, I'm using a "hidden" iframe to do my bidding.  But
    from my
    > experience, IE requires that the iframe's src attribute be set
    > initially to the url, in order for the page to open properly.  I
    > wasn't able to add the iframe to the page dynamically, either.
    >
    > So this doesn't work with IE, but it does with Firefox:
    >
    > <html>
    >  <head>
    >   <script language="javascript" type="text/javascript">
    >    function PrintAPage() {
    >      $('printer').src = 'someprintpage.html';
    >    }
    >   </script>
    >  </head>
    >  <body>
    >
    >   <span onclick="PrintAPage()">Print a page</span>
    >
    >    <iframe id="printer" height="1" width="1" ></iframe>
    > </body>
    > </html>
    >
    >
    > _______________
    >
    > As a side point, someprintpage.html would have this bit of code
    on it:
    >
    > <html>
    >  <head>
    >         <script language="javascript" type="text/javascript">
    >             window.focus();
    >             window.print();
    >         </script>
    >  </head>
    >  <body>
    >  ...
    >  </body>
    > </html>
    >
    >
    >
    > Thanks for any help
    >
    > Jim
    >
    >
    > --
    > Jim Geurts
    > Bia Creations, LLC
    > http://biacreations.com
    > 410-493-9385
    >
    ------------------------------------------------------------------------

    >
    > _______________________________________________
    > Rails-spinoffs mailing list
    > Rails-spinoffs@lists.rubyonrails.org
    <mailto:Rails-spinoffs@lists.rubyonrails.org>
    > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
    >


    _______________________________________________
    Rails-spinoffs mailing list
    Rails-spinoffs@lists.rubyonrails.org
    <mailto:Rails-spinoffs@lists.rubyonrails.org>
    http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs




--
Jim Geurts
Bia Creations, LLC
http://biacreations.com
410-493-9385
------------------------------------------------------------------------

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs


_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to