Closing Doman Auctions
DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars
HomeRegisterMembershipsGetting StartedDomain Tools Domain EbooksSEO Software Domain Resellers Advertise

Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Gold Forums > Help Wanted!
Register Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 03-04-2004, 11:41 AM   #1 (permalink)
Bob
Jedi Master
 
Bob's Avatar
 
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.
Bob is offline   Reply With Quote
Sponsored Ads
Old 03-04-2004, 01:35 PM   #2 (permalink)
DNF Member
 
Nameable's Avatar
 
Last Online: 11-05-2009 12:23 AM
iTrader: (5)
Join Date: Jan 2004
Posts: 481
DNF$: 1,039
Location: MASS
Country:

Send a message via ICQ to Nameable

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!
Nameable is offline   Reply With Quote
Old 03-04-2004, 01:50 PM   #3 (permalink)
Bob
Jedi Master
 
Bob's Avatar
 
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.
Bob is offline   Reply With Quote
Old 03-05-2004, 06:11 AM   #4 (permalink)
Exclusive Lifetime Member
 
WebCat's Avatar
 
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
WebCat is offline   Reply With Quote
Old 03-05-2004, 07:23 AM   #5 (permalink)
Alleged Cybersquatter
 
nameslave's Avatar
 
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

How about this?

http://www.faqts.com/knowledge_base/view.phtml/aid/9169
__________________
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)
nameslave is offline   Reply With Quote
Old 03-05-2004, 11:02 AM   #6 (permalink)
DNF Member
 
Nameable's Avatar
 
Last Online: 11-05-2009 12:23 AM
iTrader: (5)
Join Date: Jan 2004
Posts: 481
DNF$: 1,039
Location: MASS
Country:

Send a message via ICQ to Nameable

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.
Nameable is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -5. The time now is 06:13 PM.
Copyright @2001-2009 DNForum.com