Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Returning data from Java function to JavaScript

807569Jul 31 2006 — edited Aug 16 2006
I understand the basic idea of using JSObject's and the 'setMember' and 'getMember' funtions, but I need a little more functionality than that. I am trying to send a String array from Java to JavaScript as follows.

Here is the Java code:
public class main extends Applet
{
	public String[] Begin() 
	{
		String[] Numbers = {"one", "two", "three"};
                                           return Numbers;
	}
}
And the JavaScript code:
function SEND_WITH_ADDR_BOOK()
{
  var Names = new Array();
  Names = document.jsap.Begin();
  document.sender.resp_to.value = Names[0];
}
I'm used to C++ so this looks right to me, but it's obviously not the way to do it.

-Chris
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 13 2006
Added on Jul 31 2006
3 comments
150 views