|
-
December 4th, 2002, 03:00 AM
#1
calling java from javascript
hi!
I like to call a java file from javascript but run into error indicating unresolved class name. For a classname rd, the error states "rd is null or not a valid class". Can anyone give an idea on how to solve this? Below is my html codes & java sample file. Had been trying for many days but to no avail.
<html>
<head>
<title>Welcome!</title>
<SCRIPT LANGUAGE="JavaScript">
function read()
{
document.rd.reading();
}
</SCRIPT>
</head>
Please click here to begin
<br>
<FORM >
<INPUT TYPE=SUBMIT value="Start!" onClick="read()">
<SCRIPT LANGUAGE="JavaScript">
for(i=0;i<10;i++)
{
document.writeln( "<BR>" + rd.score[i]);
}
</SCRIPT>
</center>
</body>
</html>
import java.io.*;
public class rd
{
public static int MAX = 10;
public static byte[] score = new byte[MAX];
public void reading()
{
.....
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|