#1
  1. No Profile Picture
    Gheta
    Guest
    Devshed Newbie (0 - 499 posts)
    Please Help!
    I need to have a localized print function
    in my web page instead of using the one on the brwoser menu.
    Any one with the answer?

    Many many thanks in advance.
  2. #2
  3. No Profile Picture
    Spookster
    Guest
    Devshed Newbie (0 - 499 posts)
    Try this:

    <SCRIPT Language="Javascript">

    function printit(){
    if (NS) {
    window.print() ;
    } else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
    }
    }
    </script>

    <SCRIPT Language="Javascript">
    var NS = (navigator.appName == "Netscape");
    var VERSION = parseInt(navigator.appVersion);
    if (VERSION > 3) {
    document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');
    }
    </script>

Similar Threads

  1. Writing to two *.csv files
    By CAR in forum Perl Programming
    Replies: 4
    Last Post: February 7th, 2004, 04:39 PM
  2. need help writing emails in html through cgi
    By micronack in forum Perl Programming
    Replies: 8
    Last Post: October 1st, 2003, 06:24 AM
  3. Help with a script!
    By Chansey in forum Perl Programming
    Replies: 22
    Last Post: March 25th, 2002, 01:56 PM

IMN logo majestic logo threadwatch logo seochat tools logo