Программирование > JavaScript & JScript
Print from JS
(1/1)
lissdx:
est\' code:
//////////////////////////////////////////////
function printSelf()
{
if (browser_name == "Netscape") {
window.print() ;
} else {
var WebBrowser = \'\';
document.body.insertAdjacentHTML(\'beforeEnd\', WebBrowser);
WebBrowser1.ExecWB(6, 2);
}
}
//////////////////////////////////////////////
klasno posilaet na printer PAGE dlja NC i IE, no Opera ne
rabotaet.
Mozcet kto delal chtoto podobnoe???
P.S.
Esli kto-to uvlekalsja eventami??? "Ctrl+p" rabotaet so vsemi
browsers i posilaet na pechat\' page. Mozcno li ego sgenerirovat\' i otlovit
v ruchnuu :)))))
?????
lissdx:
:) spasibo :) reshil uzce :)))). Vot otvet :
function printSelf()
{
var browser_name = navigator.appName.toLowerCase();
var agent = navigator.userAgent.toLowerCase();
if (browser_name == "netscape" || agent.search("opera"))
{
window.print() ;
}
else
{
var WebBrowser = \'\';
document.body.insertAdjacentHTML(\'beforeEnd\', WebBrowser);
WebBrowser1.ExecWB(6, 2);
}
}
Навигация
Перейти к полной версии