views:

41

answers:

2

In the following link

<a href=\"#\" onclick=javascript:print(\"\") style=\"color:blue;\">Print</a>"
<script>
 function print()
 {
      //How to print the contents of another page
 }
A: 

Think about the security/embarrassment issues that would exist if this was possible. Thankfully, browsers won't allow you to do that.

The closest you can get is fetching the page via AJAX, replacing the current DOM with the new page, and printing with JS's normal print() method.

Coronatus
not an easy way you are talking about for a newbie at least, what is the security issue by the way?
@phpBOY - The issue is immature website owners printing porno websites when you don't expect it.
Coronatus