jzebra/jzebra.js
/**
* Monitors the Java applet until it is complete with the specified function
*    applFunc:  Should return a "true" or "false"
*    doneFunc:  Will be called if the function completes without error
*    desc:      Optional description for errors, etc
*
* Example:
*    monitorApplet('isDoneFinding()', 'alert(\\"Success\\")', '');
*/
Monitors the Java applet until it is complete with the specified function
applFunc:  Should return a "true" or "false"
doneFunc:  Will be called if the function completes without error
desc:      Optional description for errors, etc


Monitors the Java applet until it is complete with the specified function applFunc : Should return a " true " or " false " doneFunc : Will be called if the function completes without error desc : Optional description for errors etc
function monitorApplet(applFunc, doneFunc, desc) {
   if ($d && $j) {
      var done;
      try { done = eval('$j.' + applFunc); }
      catch (err) { alert(ERR + ERR_FUNC.replace('%', applFunc)); return; }
      if (!done) { window.setTimeout('monitorApplet("' + applFunc + '", "' + 
         doneFunc.replace(/\"/g,'\\"') + '", "' + desc + '")', 100); return;
      } else { 
	   var p = $j.getPrinterName();
	   if (!p) { alert(ERR + ERR_PRINT.replace('%', printerName)); return; }
	   var e = $j.getException();
	   if (e) { alert(ERR + (desc ? '' : ' [' + desc + '] ') + $j.getExceptionMessage());
	      $j.clearException();
	   } else { eval(doneFunc); }
      }
   } else {
      alert(ERR + ERR_LOAD);
   }
}
function monitorApplet ( applFunc , doneFunc , desc ) { if ( $d && $j ) { var done ; try { done = eval ( '$j.' + applFunc ) ; } catch ( err ) { alert ( ERR + ERR_FUNC . replace ( '%' , applFunc ) ) ; return ; } if ( ! done ) { window . setTimeout ( 'monitorApplet("' + applFunc + '", "' + doneFunc . replace ( / \" / g , '\\"' ) + '", "' + desc + '")' , 100 ) ; return ; } else { var p = $j . getPrinterName ( ) ; if ( ! p ) { alert ( ERR + ERR_PRINT . replace ( '%' , printerName ) ) ; return ; } var e = $j . getException ( ) ; if ( e ) { alert ( ERR + ( desc ? '' : ' [' + desc + '] ' ) + $j . getExceptionMessage ( ) ) ; $j . clearException ( ) ; } else { eval ( doneFunc ) ; } } } else { alert ( ERR + ERR_LOAD ) ; } }
Monitors the Java applet until it is complete with the specified function
applFunc:  Should return a "true" or "false"
doneFunc:  Will be called if the function completes without error
desc:      Optional description for errors, etc
Monitors the Java applet until it is complete with the specified function applFunc : Should return a " true " or " false " doneFunc : Will be called if the function completes without error desc : Optional description for errors etc