• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

JavaScript to Java Applet arrays

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic