• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaScript to Java Applet arrays  RSS feed

Lionel, Hutz
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to pass a JavaScript array to a Java Applet. However, it keeps spitting errors. This is how i'm creating and passing the array:
function CreateObject(_pageName,_objectType,_objectName){
var params = new Array();
var j=0;
for(var i=3;i<CreateObject.arguments.length;i++){
params[j] = CreateObject.arguments[i]+"";
/*for(var i=0;i<params.length;i++)
document.write(params[i]+" ");*/
"OM" is the java applet. _pageName,_objectType, & _objectName are ok, but when I tried reading the params array it chokes.
The java function is:
public int createObject(String _pageName, String _objectType, String _objectName, String[] _params) {
for(int i=0;i<_params.length;i++)
return -1;
Anything wrong here? wrong logic? wrong syntax? Do I need to receive the _params array as a JSObject[] instead?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!