Thread Javascript print() Frage
(2 answers)
Opened by Kuerbis at 2011-08-21 19:31
Hallo,
ist es möglich, dieses Skript so anzupassen, dass der Print-Button nicht mitgedruckt wird? Code (perl): (dl
)
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 #!/usr/local/bin/perl use warnings; use 5.012; use utf8; use CGI; my $javascript = <<END; function printpage() { window.print() } END my $cgi = CGI->new(); print $cgi->header( -charset => 'UTF-8' ); print $cgi->start_html( -script => { -type => "text/javascript", -code => $javascript } ); print $cgi->p( 'Hello World' ); print $cgi->start_form(); print $cgi->button( -name => "button_1", -value => "Print", -onClick => "printpage()" ); print $cgi->end_form(); print $cgi->end_html; |