#1
  1. webber
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2000
    Location
    San Juan - Argentina
    Posts
    594
    Rep Power
    15

    Unhappy Print a document using JavaScript


    How can i add to my site a button and when user presses that button, the site prints itself...?

    Thanks in advance.
    Enrique Becerra
    CodeIgniter, Joomla & Java Development
    www.itexa.com.ar
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2001
    Location
    England
    Posts
    967
    Rep Power
    14
    <a href="javascript:window.print();">Print</a>.... as far as I know, you can only print one page at a time rather than the whole site, without doing some server side stuff.
  4. #3
  5. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    Stuttgart
    Posts
    21
    Rep Power
    0

    so zum beispiel


    <a href="#" onClick="window.print();return false">druck mich </a>
  6. #4
  7. webber
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2000
    Location
    San Juan - Argentina
    Posts
    594
    Rep Power
    15

    Angry Didn't work & dunno why


    I get an error when i press the button (or link) or image(with link)
    I've tried with all and get this error:
    (tried with window.print()) as i was told...

    ...
    "The object don't accept this property or method"
    ...
    Do you want to keep executing JavaScript on this page?
    YES NO

    Does anyonw have a working example?
    I'm newbie at JAvaScript... as you may have noticed...

    Thanks...

    Maybe i have to replace window by _self or by _parent ?
    Enrique Becerra
    CodeIgniter, Joomla & Java Development
    www.itexa.com.ar

IMN logo majestic logo threadwatch logo seochat tools logo