Reputation: 301
I'm trying to save the value as 1
if it succeed (return true) and 0
it it failed (return false) in the database.
Upvotes: 2
Views: 2925
Reputation: 64536
No, window.print()
is a void, it doesn't return a value and so you can't determine if the dialog was opened or indeed whether or not the document was actually printed.
Related - there is an onafterprint
event but it is not currently cross-browser.
From MDN:
Some browsers (including Firefox 6 and later and Internet Explorer) send beforeprint and afterprint events to let content determine when printing may have occurred. You can use this to adjust the user interface presented during printing (such as by displaying or hiding user interface elements during the print process).
Upvotes: 2
Reputation: 5108
The print dialog box is part of the operating system. Javascript can only access items that are part of the web page.
Upvotes: 0