StephanM
asked on
Exchange arrays between Java applets and JavaScript functions?
In a html-page I want to exchange arrays beetween JavaScript functions and Java applet functions.
I´ve tried the following code, but it returns with the script error
"No Java method matching arguments."
Here are my sample files:
JavaParameterTest.java
import java.applet.*;
public class JavaParameterTest extends Applet
{
public JavaParameterTest()
{
}
public String Test(String Ar[], int i) {
return Ar[i];
}
}
JavaParameterTest.html:
<html>
<head>
<title>JavaParameterTest</ title>
<script>
testarray = new Array("Peter","Paul","Mary ");
function test() {
alert(document.JavaParamet erTest.Tes t(testarra y(),1));
}
</script>
</head>
<body onload="test();">
<applet
code=JavaParameterTest.cla ss
name=JavaParameterTest
</applet>
</body>
</html>
I there any chance to modify this code, so does it works on IE 3.0 and NS 3.0?
I would appreciate any help.
I´ve tried the following code, but it returns with the script error
"No Java method matching arguments."
Here are my sample files:
JavaParameterTest.java
import java.applet.*;
public class JavaParameterTest extends Applet
{
public JavaParameterTest()
{
}
public String Test(String Ar[], int i) {
return Ar[i];
}
}
JavaParameterTest.html:
<html>
<head>
<title>JavaParameterTest</
<script>
testarray = new Array("Peter","Paul","Mary
function test() {
alert(document.JavaParamet
}
</script>
</head>
<body onload="test();">
<applet
code=JavaParameterTest.cla
name=JavaParameterTest
</applet>
</body>
</html>
I there any chance to modify this code, so does it works on IE 3.0 and NS 3.0?
I would appreciate any help.
ASKER
Your proposal is not the right solution, because if I change
the argument for my applet from testarray() to testarray[],
it produces a syntax error in Netscape. Sorry.
the argument for my applet from testarray() to testarray[],
it produces a syntax error in Netscape. Sorry.
ASKER
Adjusted points to 120
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your response. I´ve checked it and it´s true -
there is in fact no chance to exchange arrays in the ie.
Concentrating on content and not on incompatibilities
would be nice, but I don´t think it will happen.
Over and out, StephanM.
there is in fact no chance to exchange arrays in the ie.
Concentrating on content and not on incompatibilities
would be nice, but I don´t think it will happen.
Over and out, StephanM.
To pass an array use testarray[].