Hi
I'm trying to call a Java class from within my JavaScript and its not seeing the class. I have the class file in the same directory..so why can't it see it? What am I doing wrong?
yeah i'm crap at explaining things.. this is what I've done. My Java class is Stemmer and I need to use the stemWord method. Thought I should try and create a constructor?
What you think?
<html>
<head><title>JavaScript to Java Stemmer Example</title>
<script language="JavaScript1.2">
function swhandler()
{
var word = document.stemmer.word.value;
var stemObj = new Packages.Stemmer();
var stemmedWord = stemObj.stemWord(word);
document.stemmer.stemmedWord.value = stemmedWord;
<!-- Call Java Stemmer class.
-->
}
</script>
</head>
<body bgcolor = "white">
<!--
This is an HTML form that allows the user to enter data and allows JavaScript to
display the results it computes using a Java Stemmer Class back to the user.
-->
<form name="stemmer">
<table>
<tr>
<td>1)</td>
<td>Please insert word to be stemmed:</td>
Yeap..all I found was stuff on JSObject or LiveConnect or using Applets and I don't think thats what I need, may be the LiveConnect part? I want to directly access and use my Java classes from my JavaScript code. I want to go from JavaScript to Java not Java to JavaScript. Do you have any ideas of what to try?
No I can't do that..because I will be needing to access alot of the Java classes I've already wrote so I wanted to figure the whole Javascript to Java communication thing out now if I can...any other suggestions? There has to be some way to do it?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.