• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript to Java Applet arrays

 
Lionel, Hutz
Greenhorn
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]+"";
j++;
}
/*for(var i=0;i<params.length;i++)
document.write(params[i]+" ");*/
if(OM){
OM.createObject_pageName,_objectType,_objectName,params);
}
}
"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++)
System.out.println(_params[i]);
return -1;
}
Anything wrong here? wrong logic? wrong syntax? Do I need to receive the _params array as a JSObject[] instead?
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic