OVH Cloud OVH Cloud

recuperer un Boolean depuis une Applet dans JavaScript

1 réponse
Avatar
pcouas
Bonjour,

Je cherche a recuperer la valeur d'un boolean d'une applet dans mon
code JSCRIPT pour le tester .
Je ne vois pas mon erreur, mais je dois avoir le nez dessus !
Merci
Philippe


1 voici la creation de la page Popup HTML

top.win2=window.open("",file,"resizable=yes,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,copyhistory=0,width=920,height=520")
top.win2.document.write("<OBJECT classid =
\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\""); //EN 1.4.2 dynamic
top.win2.document.write(" WIDTH = 900");
top.win2.document.write(" HEIGHT = 500");
top.win2.document.write(" name = 'graph'");
top.win2.document.write("
codebase=\"http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0\"
>");
top.win2.document.write("");
top.win2.document.write("</OBJECT>");
top.win2.document.write("");
top.win2.document.write("</body>");
top.win2.document.write("</html>");
top.win2.document.close();

2 fonction de conversion JSCRIPT
function convertojscriptstring(tmp)
{
var myJSString = eval(tmp);
return myJSString += ""; //convert to javascript
}


3 Mon Test
if (isObject(top.win2) && top.win2 && !top.win2.closed &&
convertojscriptstring(top.win2.document.graph.getinuse()).indexOf('true')
!= -1))


4 Morceau de l'applet Java
public String getinuse()
{
return Boolean.toString(inuse);
}

1 réponse

Avatar
Real Gagnon
Je cherche a recuperer la valeur d'un boolean d'une applet dans mon
code JSCRIPT pour le tester .
Je ne vois pas mon erreur, mais je dois avoir le nez dessus !
Merci
Philippe



Essayer d'ajouter a la balise OBJECT

<PARAM NAME="scriptable" value="true">

Ceci est necessaire pourune interaction Javascript vers Java (depuis
1.2.2).

Pour une interaction Java vers Javascript c'est

<PARAM NAME="mayscript" value="true">

Bye.
--
Real Gagnon from Quebec, Canada
* Looking for Java or PB code examples ? Visit Real's How-to
* http://www.rgagnon.com/howto.html