Need a script. help

this is the script that i have to print my page. i am looking for a way to print it without printing the print button also. if anybopdy could help it would be greatly appreciated.



/*
This script is written by Eric (Webcrawl@usa.net)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

function printit(){
if (NS) {
window.print() ;
} else {
var WebBrowser = '';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
}
}



var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
document.write('');
}





Comments

  • : this is the script that i have to print my page. i am looking for a way to print it without printing the print button also. if anybopdy could help it would be greatly appreciated.
    :
    :
    :
    : /*
    : This script is written by Eric (Webcrawl@usa.net)
    : For full source code, installation instructions,
    : 100's more DHTML scripts, and Terms Of
    : Use, visit dynamicdrive.com
    : */
    :
    : function printit(){
    : if (NS) {
    : window.print() ;
    : } else {
    : var WebBrowser = '';
    : document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    : WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
    : }
    : }
    :
    :
    :
    : var NS = (navigator.appName == "Netscape");
    : var VERSION = parseInt(navigator.appVersion);
    : if (VERSION > 3) {
    : document.write('');
    : }
    :
    :

    Put the first script in your head section, then call it by placing onLoad="printit()" in the body, like this:




    function printit(){
    if (NS) {
    window.print() ;
    } else {
    var WebBrowser = '';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
    }
    }




    ...


    But I don't know how this will turn out in 'heavy' pages, ie. those that take a long time to load.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion