Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 6 of 6
  1. #1
    Jedi Master
    Bob's Avatar
    Join Date
    Apr 2002
    Posts
    3,133
    DNF$
    49,605
    Bank
    0
    Total DNF$
    49,605
    Donate  

    Simple (?) JavaScript Question

    I want to print out a webpage via the window.print() command.

    According to my documentation, window.print() acts exactly as if the user had clicked the "print" button. However, when the command is invoked, the print dialog box ALWAYS pops up.

    When I click the little printer at the top of the IE browser, the page just goes to the printer. When I click "File->Print" I always get the print dialog box.

    Is there a way to print the webpage without having the print dialog box come up and forcing the user to actually click "OK" or "Cancel" (i.e. simulate the little print icon at the top of the IE browser)?


    -Bob
    . . .

  2. #2
    DNF Member
    Nameable's Avatar
    Join Date
    Jan 2004
    Location
    MASS
    Posts
    483
    DNF$
    51,543
    Bank
    0
    Total DNF$
    51,543
    Donate  

    Re: Simple (?) JavaScript Question

    Unfortunately the answer is no.

    Javascript doesn't provide a method for "print immediately" -- this would have to be pretty browser specific, as many browsers don't even have a "print immediately" functionality.

    We looked into making an activex control to do it, but the client didn't want to pay for that. Post here if you find a free one!

  3. #3
    Jedi Master
    Bob's Avatar
    Join Date
    Apr 2002
    Posts
    3,133
    DNF$
    49,605
    Bank
    0
    Total DNF$
    49,605
    Donate  

    Re: Simple (?) JavaScript Question

    I figured out that I cannot do that after I posted my message. UGH. It makes sense though. How would you like to go to a website and haveyour printer start printing a complete unedited version of "War and Peace"?

    My solution was to put everything I want to print on the browser screen and then issue the window.print() command after that. That eliminated the client from having to click the "Print" button in the print dialog box 800 times and only forces them to do it only once.

    I also had the problem of making the output come out on nice pages and not having it all crammed together (i.e. the second page starts half way down the first page). Since HTML does not have a page-break tag, I was able to solve that problem by using a style. (style="page-break-after: always")

    Coding - always an interesting job.

    -Bob
    . . .

  4. #4
    Exclusive Lifetime Member
    WebCat's Avatar
    Join Date
    Mar 2003
    Location
    Southern California
    Posts
    1,031
    DNF$
    21,801
    Bank
    0
    Total DNF$
    21,801
    Donate  

    Re: Simple (?) JavaScript Question

    Bob, now I understand why you have so much patience!

    WebCat
    /\_/\
    (0 0) php! Perl! Apache! javascript! Linux! CSS! .......AHRRGGGG!
    >^<
    \__/
    MetallicaForum.com - DomainElf.com - Exclaims.net
    DomainExpires.com - TouringSound.com - SongNet.us
    SongClick.com - DedicatedTraffic.com - AmericanMovie.us

  5. #5
    a.k.a. Nameslave
    Anthony Ng's Avatar
    Join Date
    May 2002
    Location
    Toronto, ON
    Posts
    4,975
    Country

    Canada Follow Anthony Ng On Twitter Add Anthony Ng on Facebook
    DNF$
    4,093
    Bank
    0
    Total DNF$
    4,093
    Donate  

    Re: Simple (?) JavaScript Question

    Profoundly influenced by #Bauhaus, Nameslave unrepentantly embraces Minimalism in his #multimedia portfolio. His early works include an experimental adaptation of Chekhov’s Cherry Orchard using the #Minimalist method inspired at least partly by the music of Robert Fripp. His totally irrelevant M.Ed. dissertation examines Organizational Culture and Change Management.

  6. #6
    DNF Member
    Nameable's Avatar
    Join Date
    Jan 2004
    Location
    MASS
    Posts
    483
    DNF$
    51,543
    Bank
    0
    Total DNF$
    51,543
    Donate  

    Re: Simple (?) JavaScript Question

    WOW! Thanks nameslave.

    FYI- it's an IE-only solution, but a solution nonetheless. Hopefully bad people don't get a hold of this, or we could be killing an exceptional number of trees.

Similar Threads

  1. Simple copyrights question
    By lux in forum Domain Name Legal Issues
    Replies: 7
    Last Post: 06-24-2003, 08:37 AM
  2. Simple ENOM Question
    By DeCal in forum General Domain Name Discussion
    Replies: 12
    Last Post: 02-14-2003, 08:32 AM
  3. A simple question...
    By BURNING RIOT in forum Gold Cafe
    Replies: 1
    Last Post: 11-21-2002, 04:12 PM
  4. Type-in traffic question + 1 word domain question
    By 95degrees in forum Gold Cafe
    Replies: 0
    Last Post: 10-13-2002, 01:52 PM

Bookmarks

Posting Permissions

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

Domain name forum recommended by Domaining.com