Topic: Probably a dumb dumb question... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28134" title="Pages that link to Topic: Probably a dumb dumb question... (Page 1 of 1)" rel="nofollow" >Topic: Probably a dumb dumb question... <span class="small">(Page 1 of 1)</span>\

 
dade
Nervous Wreck (II) Inmate

From: Kansas, just this side of the rainbow
Insane since: Sep 2004

posted posted 06-27-2006 21:07

I am working on a program that will be set on an Intranet and go through people's web browser. Is there a way to code in a button that they click on that submits an invoice and simultaneously opens the print window so that they can print out a copy? I am not much a javascript guy, but I thought that javascript is the best chance at this actually happening.

Thank you,

dade

This patient is ready for his medication!

dade
Nervous Wreck (II) Inmate

From: Kansas, just this side of the rainbow
Insane since: Sep 2004

posted posted 06-27-2006 21:29

Okay, I am finding a bit on this topic:
http://www.quirksmode.org/js/print.html#

But I do not like the guy who wrote it, because he cannot explain why things work. And I fully admit, I do not know very much about javascript...But, it seems like there are several things that are repetitive, like error messages.

A much better link I found:
http://www.htmlgoodies.com/beyond/javascript/article.php/3471121

This one should be higher in a google search than the other link. I think I found my answer with this one.

dade

This patient is ready for his medication!

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-27-2006 22:07

Window.Print plus perhaps hiding/displaying some parts of the current page is usually indeed the way to go.

Holler if you need more help

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-27-2006 23:18
quote:
hiding/displaying some parts

why not simply having a stylesheet for the 'print' media ? even IE5 supports this media.



(Edited by poi on 06-27-2006 23:19)

_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

posted posted 06-28-2006 01:08
quote:

But I do not like the guy who wrote it, because he cannot explain why things work.



^^and more importantly, who cares about "why" they work when you're beginning at
js? When you're ready for reverse engineering browsers down to the assembler,
you'll be ready to blame the guy for "not explaining why things work".

Quirksmode is some humble, top quality resource about browser quirks,
it's actual purpose is to point out, test and benchmark things that don't work as they should,
and give you means to "turn tables".

Taste is personal, but staying below the rain that falls wondering why it falls...

Is not "exactly" the best mindset to become a javascript guy.
my 2 cents.

(Edited by _Mauro on 06-28-2006 01:09)

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-28-2006 08:48

Did I say how I hide those parts ?

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-28-2006 09:48

Tyberius Prime: Well, the phrasing wasn't really clear. Using action verbs rather suggested an active solution including old fashioned JavaScript than a passive method like having a 'print' stylesheet.

But you've got the benefit of the doubt for this time. Be careful young man. Be very careful

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 07-10-2006 00:39

After doing CORBA and been giving various snippets to learn off and re-use I can totally understand why you'd want to know how it works, especially if you want to modify it, beginner or not.

I second the stylesheet method, but if you know your audience will always have the same browser etc.. a quick snippet of some IE code could be handier. From what I can tell all you need is window.print();



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu