Print Window On Load

Sometimes we require to show the print dialog on as soon as we load the Web Page, the following piece of script can achieve the same, simply paste the script block on the page and you will see the Windows print dialog when you load the webPage.

--------------------------------------------------------------------------------------------------------------------------------------

The readyState property indicates the current state of the XML document.

This property is read-only and returns one of the following values indicating the instantiation and download state of the XML document.

  • LOADING
    loading in progress; reading persisted properties but not yet started parsing data. For purposes of the standard readyState definitions, data should be considered equivalent to BLOB properties.
  • LOADED
    reading of persisted properties completed; reading and parsing data, but the object model is not yet available.
  • INTERACTIVE
    some data has been read and parsed, and the object model is available on the partially received data set. The object model at this stage is read-only.
  • COMPLETED
    the document has been completely loaded, successfully or unsuccessfully.

This property is a Microsoft extension to the W3C DOM.

This article is part of the GWB Archives. Original Author: Narendra Tiwari

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.