

![]() |
| ![]() | |||||||
|
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Jedi Master Name: Bob Last Online: 11-20-2009 08:54 AM iTrader: (74) Join Date: Apr 2002
Posts: 2,980
DNF$: 140 Location: Massachusetts
Country: | 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
__________________ The massive purge has begun. |
| | |
| Sponsored Ads |
| | #2 (permalink) |
| DNF Member Last Online: 11-05-2009 12:23 AM iTrader: (5) Join Date: Jan 2004
Posts: 481
DNF$: 1,039 Location: MASS
Country: | 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 (permalink) |
| Jedi Master Name: Bob Last Online: 11-20-2009 08:54 AM iTrader: (74) Join Date: Apr 2002
Posts: 2,980
DNF$: 140 Location: Massachusetts
Country: | 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
__________________ The massive purge has begun. |
| | |
| | #4 (permalink) |
| Exclusive Lifetime Member Last Online: 04-09-2007 06:29 PM iTrader: (0) Join Date: Mar 2003
Posts: 1,031
DNF$: 21,741 Location: Southern California | 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 (permalink) |
| Alleged Cybersquatter Last Online: Today 12:10 PM iTrader: (15) Join Date: May 2002
Posts: 4,786
DNF$: 2,403 Location: Toronto, ON
Country: | Re: Simple (?) JavaScript Question
__________________ SELLING - chinatradeblog.com ($1,000), chinatradeforum.com ($1,000), sinotown.com (US$500) SOLD 2009 - jinggangshan.com (US$4,000), lujiazui.com (US$3,000), jinqiao.com (US$3,000) |
| | |
| | #6 (permalink) |
| DNF Member Last Online: 11-05-2009 12:23 AM iTrader: (5) Join Date: Jan 2004
Posts: 481
DNF$: 1,039 Location: MASS
Country: | 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. |
| | |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple copyrights question | lux | Domain Name Legal Issues | 7 | 06-24-2003 08:37 AM |
| Simple ENOM Question | DeCal | Domain Registration Discussion | 12 | 02-14-2003 08:32 AM |
| A simple question... | BURNING RIOT | Gold Cafe | 1 | 11-21-2002 04:12 PM |
| Type-in traffic question + 1 word domain question | 95degrees | Gold Cafe | 0 | 10-13-2002 01:52 PM |