5 Replies Latest reply on Sep 7, 2010 12:19 PM by 843802

    Important addition to deployJava.js


      We slowly started to use deployJava.js on our produciton servers, and except few problems with Mac, it works pretty good. Today we needed dynamically (on a click), to populate a DIV with code like this, to start an applet.
          var attributes = {codebase:'http://java.sun.com/products/plugin/1.5.0/demos/jfc/Java2D',
                            width:710, height:540} ;
          var parameters = {fontSize:16} ;
          var version = '1.6.0' ;
          deployJava.runApplet(attributes, parameters, version);
      And the reason why we don't do it at page load, because we don't want to run an applet everytime somebody visits the page, only when they click on a button. So, the problem was, that deployJava.runApplet method, which calls writeAppletTag method uses document.write(), which completely destroys content of the page. So, we had to make a local copy of deployJava.js, and change document.write() to just return us a string, which then we populate using innterHTML, and applet worked like a charm.

      So, since it's not a good idea to have a local copy of this deploy js tool, I would like to ask Sun to create a special method, which would return a HTML instead of using document.write directly.

      Thank you in advance,