Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    window.print() for mac

    window.print() works on pc but not for mac. How can i make a printable page for mac users?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    window.print() doesn't "make a printable page" on PCs either. Which question are you really asking?

    1) How can I duplicate the funcitonality of window.print() for Macs
    2) How can I create a printer friendly page?
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have a button, when you press it you can print the html page you see on screen. Just href="javascript:window.print()".
    This works on pc (you can print the page) but in mac nothing happends... It doesn't "read" the function js window.print...

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    As far as I know print() works only for NS on Mac, not for IE, I don't know why. And tere is no other function in JavaScript to do that for IE on Mac.

    So, as a friend said..." choose "File" from browser's menu, then choose "Print" an here it is!" :-)
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Well, maybe here
    http://www.oreillynet.com/pub/a/java...s_for_mac.html

    you might get a solution
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Interesting link, Kor, but I doubt that will work. It talks about using JavaScript with Mac OS's Open Scripting Architechture - not in a web browser. I doubt the necessary objects (such as MacOs) are exposed to a browser.

    Also, it is clear to see from the bottom of this page, that IE-Mac doesn't support window.print()

    Sorry, I think you're SOL.
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #7
    New Coder
    Join Date
    Jul 2003
    Location
    Essex, UK
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Will this script work?

    Code:
    <SCRIPT Language="Javascript">
    function printit(){  
    if (window.print) {
        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>');        
    }
    I don't have a Mac so I cannot test it, but I hope it works!

  • #8
    New Coder
    Join Date
    Aug 2003
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The one above dosn't work, I've got a mac and IE and I tested it and it makes the whole page vanish.
    Now known as Error 404
    This account is as dead as a parrot


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •