Help with javascript:window.print()

Ask a Question related to Adobe Dreamweaver & Contribute, Design and Development.

  1. #1

    Default Help with javascript:window.print()

    I am trying to send a specific page to the printer using
    javascript:window.print(). There has to be a way top so this. I assume the
    variable can be placed in the parantheses like so

    javascript:window.print(label.asp?MSDSID=004984)

    I'm getting an error. Can someone shed some light on this for me?

    Fedic Guest

  2. Similar Questions and Discussions

    1. Print Flashfile from javascript
      I was wondering if it would be possible to access the rightclick Print menu on a flashfile from javascript. I'd like to automate the printing of...
    2. Trouble with javascript:window.print
      My page is an ASP with a lot of VB. Go to http://71.97.138.65/isgmsds/ Then go to http://71.97.138.65/isgmsds/search(new).asp?t=i You will...
    3. javascript: window.print() only creates 1st page of document
      Acrobat Professional 6.0 Windows 2000 Server I am trying to print a browser popup window with the window.print() function. The window has 5 pages...
    4. Discrepancy in color between Photoshop window and print window
      My photos look very dark and saturated when I load them in Photoshop 7 or Photoshop Elements 2.0, but when viewed in the printer's preview window...
    5. Javascript in ASP.NET - Pop another window
      I've got a web form with a number of dropdowns, combos, etc. When the user submits the form, I want to redirect them to another form, but I need to...
  3. #2

    Default Re: Help with javascript:window.print()

    You could have something like

    <link rel="alternate" media="print" href="label.asp?MSDSID=004984">

    Might not work in all browsers though.

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

  4. #3

    Default Re: Help with javascript:window.print()

    I could find no such usage, Jules, in the O'Reilly references. While href
    is allowed in the link tag, it doesn't appear to function as you show below.

    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================

    "Julian Roberts" <newsg@charon.co.uk> wrote in message
    news:d0pl83$n7u$1@forums.macromedia.com...
    > You could have something like
    >
    > <link rel="alternate" media="print" href="label.asp?MSDSID=004984">
    >
    > Might not work in all browsers though.
    >
    > --
    > Jules
    > [url]http://www.charon.co.uk/charoncart[/url]
    > Charon Cart 3
    > Shopping Cart Extension for Dreamweaver MX/MX 2004
    >
    >

    Murray *TMM* Guest

  5. #4

    Default Re: Help with javascript:window.print()

    It works in IE.

    print.asp:

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <link rel="alternate" media="print" href="print_page.asp">
    </head>
    <body>
    <p><a href="javascript:window.print()">print</a></p>
    </body>
    </html>

    print_page.asp:

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    </head>
    <body>
    boo
    </body>
    </html>

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004



    Julian Roberts Guest

  6. #5

    Default Re: Help with javascript:window.print()

    Do you have them mounted? Can you post a link?

    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================

    "Julian Roberts" <newsg@charon.co.uk> wrote in message
    news:d0pngr$r2i$1@forums.macromedia.com...
    > It works in IE.
    >
    > print.asp:
    >
    > <html>
    > <head>
    > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    > <title>Untitled Document</title>
    > <link rel="alternate" media="print" href="print_page.asp">
    > </head>
    > <body>
    > <p><a href="javascript:window.print()">print</a></p>
    > </body>
    > </html>
    >
    > print_page.asp:
    >
    > <html>
    > <head>
    > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    > <title>Untitled Document</title>
    > </head>
    > <body>
    > boo
    > </body>
    > </html>
    >
    > --
    > Jules
    > [url]http://www.charon.co.uk/charoncart[/url]
    > Charon Cart 3
    > Shopping Cart Extension for Dreamweaver MX/MX 2004
    >
    >
    >

    Murray *TMM* Guest

  7. #6

    Default Re: Help with javascript:window.print()

    Go to [url]http://71.97.138.65/isgmsds/[/url]

    Then go to [url]http://71.97.138.65/isgmsds/search(new).asp?t=i[/url]

    You will see the link to the far right that takes the user to a page formatted
    to print a label. I want this page (label.asp) to be instantly sent to the
    printer. If I can't send it directly to the printer then I want to generate a
    print dialog that will print this page without opening that label formatted
    page in a browser window.

    My code for this cell in my table is as follows:

    Response.Write "<td valign='top'><font face='arial' size='1'><a
    href='label.asp?MSDSID=" & strMSDS & "'>&nbsp; Label &nbsp;</a></font></td>" &
    tsgDebug

    Fedic Guest

  8. #7

    Default Re: Help with javascript:window.print()

    In IE, go here

    [url]http://www.charon.co.uk/misc/print.asp[/url]

    it should print out

    [url]http://www.charon.co.uk/misc/print_page.asp[/url]

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

  9. #8

    Default Re: Help with javascript:window.print()

    Thanks. As expected it fails utterly in IE5x/Mac. In both FF and Safari
    (PC) and , it triggers the print, but only of the page itself, not of
    print_page.asp. It seems to only work in IE6/PC (didn't check earlier
    versions).


    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================

    "Julian Roberts" <newsg@charon.co.uk> wrote in message
    news:d0qbtq$31p$1@forums.macromedia.com...
    > In IE, go here
    >
    > [url]http://www.charon.co.uk/misc/print.asp[/url]
    >
    > it should print out
    >
    > [url]http://www.charon.co.uk/misc/print_page.asp[/url]
    >
    > --
    > Jules
    > [url]http://www.charon.co.uk/charoncart[/url]
    > Charon Cart 3
    > Shopping Cart Extension for Dreamweaver MX/MX 2004
    >
    >

    Murray *TMM* Guest

  10. #9

    Default Re: Help with javascript:window.print()

    Yup, I believe it only works in IE. May be good enough for Fedic.

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

  11. #10

    Default Re: Help with javascript:window.print()

    I have an interim solution. The user clicks on the link which takes the user
    to a page formatted for my label printer. The page initiates the print
    function and returns to the previous page through an onload in the body tag.

    Any comments or suggestions on this solution?

    Fedic Guest

  12. #11

    Default Re: Help with javascript:window.print()

    Don't usse a print function at all. Let the visitor use FILE | Print.
    Everyone knows how to do it.

    Onloads will fail for this purpose.

    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================

    "Fedic" <webforumsuser@macromedia.com> wrote in message
    news:d0s6l3$qj1$1@forums.macromedia.com...
    >I have an interim solution. The user clicks on the link which takes the
    >user
    > to a page formatted for my label printer. The page initiates the print
    > function and returns to the previous page through an onload in the body
    > tag.
    >
    > Any comments or suggestions on this solution?
    >

    Murray *TMM* Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139