javascript - Java Applet is undefined -
i have jzebra applet need client side ticket printing.
this applets html definition:
<applet id="jzebra" name="jzebra" code="jzebra.printapplet.class" archive="../../../../../../web/org.openbravo.howtos/lib/jzebra.jar" width="10px" height="10px">
the function
call in form button this:
function printdocument() { var applet = document.jzebra; var frm = document.frmmain; var url = frm.elements["inpftpobdir"].value; var file ="0.txt"; var archivo = url + "/" + file; if (applet != null) { var printname = frm.elements["inpprintername"].value; var indice = frm.inpprinterselected.selectedindex; var printselected = frm.inpprinterselected.options[indice].text; alert(printname); alert(printselected); if(printselected == ""){ // printname = "zebra" //alert('default : ' + printname); applet.findprinter(printname); monitorfinding(); } else { //alert('selected : ' + printselected); applet.findprinter(printname); monitorfinding(); } alert('file : ' + archivo); // applet.findprinter(printname); applet.appendfile(archivo); // send characters/raw commands printer applet.print(); alert('the document sent printer.'); } }
i checked console , there definition of applet, when reaches applet.findprinter(printname)
, explodes because applet.findprinter
not function.
has faced struggle before? have seen there little gray square in top left corner of page. when hover
on it, displays "undefined
".
i came complex solution, having use jnlp. post code later references, if else find similar problems.
Comments
Post a Comment