-
FEATURED COMPONENTS
First time here? Check out the FAQ!
My task is using hidden signed applet which support cryptography functions. Applet has to be loaded dynamically.
I try to use this example: (no links, just open first google search result from Oracle website) "invoking Applet Methods From JavaScript". The problem is when the applet is loaded and deployed with "deployJava.js" ZK window is disappearing.
My code is:
function loadScript(url, callback)
{
// Adding the script tag to the head as suggested before
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
// Then bind the event to the callback function.
// There are several events for cross browser compatibility.
script.onreadystatechange = callback;
script.onload = callback;
// Fire the loading
head.appendChild(script);
callback();
}
function startApplet() {
var invokeApplet = function () {
var attributes = { id:'cryptoApplet', code:'CryptoApplet', width:1, height:1} ;
var parameters = { jar: 'clientcrypto.jar'} ;
deployJava.runApplet(attributes, parameters, '1.7');
};
loadScript("/js/deployJava.js", invokeApplet);
}
The problem of disappearing happens because deployJava.js use "document.write(applet tag)" to add an applet. I add div component to the page which has width="1", height="1", and rewrite deployJava.js to append applet in that div. And it's worked.
So I add an applet to page dynamically with modified deployJava.js script.
Asked: 2014-01-22 10:55:08 +0800
Seen: 15 times
Last updated: Mar 06 '14
update listbox by client javascript
Facing issue in masking on phone [closed]
coerceFromString_ override no longer works from 6.5.1 [closed]
Execute Javascript on component visible
Is there a way to resolve view model properties as input to client side javascripts?