Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<!--
// ====================================================================
// Original post: Unkown person - I lost my notes on who did this first
// Unkown source
// Modified by: Walter Torres <walter@torres.ws> [www.torres.ws]
// 4/29/2001
// I found the secret to remove the prompt!
// Original post did not have this gem to it.
//
// This accesses a built-in Windows command that can perform Magic!
// And yes, this is a Windows ONLY solution.
// In fact, it only works in IE. :(
//
// INPUT: intOLEcmd = integer between 1 and 37,only a few are of use
// intOLEparam = parameter integer for function - optional
// OUTPUT: none
// DEPENDANCIES: none
//
// NOTE: intOLEparam is not optional in the Object call,
// I just made it optional here to make life easier.
// All command values use '1' execept print, thus my reasoning.
//
// EXAMPLE: // This prints given window/frame WITHOUT prompt!
// <button onClick="objWinName.ieExecWB(6, -1)">
// Print Me! - No Prompt!
// </button>
//
// // This prints given window/frame WITH prompt!
// <button onClick="objWinName.ieExecWB(6)">
// Print Me! - Prompt
// </button>
//
// // This will display the Print Preview window
// <button onClick="objWinName.ieExecWB(7)">
// Print Preview
// </button>
//
// VALUES: intOLEcmd has these possible values
// OLECMDID_OPEN = 1
// OLECMDID_NEW = 2 warning, this kills IE windows!
// OLECMDID_SAVE = 3
// OLECMDID_SAVEAS = 4
// OLECMDID_SAVECOPYAS = 5 note: does nothing in IE
// OLECMDID_PRINT = 6 note: give '-1' as param - no prompt!
// OLECMDID_PRINTPREVIEW = 7
// OLECMDID_PAGESETUP = 8
// Others have no use in IE
-->
<script language=javascript>
function doThis() {
var answer = confirm("Receipt is ready. Are you ready to print it?");
if (answer == true)
ieExecWB(6, -1)
}
</script>
</head>
<body onload="doThis();">
<form>
This is a test print page.
<br><br>
This prints given window/frame WITHOUT prompt!
<button onClick="ieExecWB(6, -1)">Print Me! - No Prompt!</button>
<br><br>
This prints given window/frame WITH prompt!
<button onClick="ieExecWB(6)">Print Me! - Prompt</button>
<br><br>
This will display the Print Preview window
<button onClick="ieExecWB(7)">Print Preview</button>
<script language=javascript>
function ieExecWB( intOLEcmd, intOLEparam ) {
// Create OLE Object
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
// Place Object on page
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
// if intOLEparam is not defined, set it
if ( ( ! intOLEparam ) || ( intOLEparam < -1 ) || (
intOLEparam > 1 ) )
intOLEparam = 1;
// Execute Object
WebBrowser1.ExecWB( intOLEcmd, intOLEparam );
// Destroy Object
WebBrowser1.outerHTML = "";
}
// eof
</script>
</form>
</body>
</html>