title: Printing a (part of) webpage with Javascript
body: <p>I am aware of two ways of calling the "print" dialog of browser (I used the Search, of course):</p>
  
  <ul>
  <li>document.print()</li>
  <li>document.execCommand('print', false, null)</li>
  </ul>
  
  <p>What is the difference between them? Support across browsers? Papers, docs or standards? Which is more correct thing to use?</p>
  
  <p>Another question: what is the most straight way to print given part of a webpage? I know we can create new window or iframe to call any of two print methods above. Which one has less pitfalls?</p>