Update: I was wrong naming a plain JavaScript object as "JSON object". Thanks to guys who pointed it out in comments below. So I edited the question to avoid further misunderstanding.
I wonder whether calling JavaScript function with JavaScript object (that can be described as JSON string) as an argument using netscape.javascript.JSObject is possible from Java. I tried the following code snippet:
JSObject.getWindow(MyApplet.this).call(jsFunctionName, jsArgs);
According to this article Java objects are passed to named JavaScript function as is and will be automatically converted to some JavaScript primitives depending on context they are used in. Does it mean that it is impossible to pass a real JavaScript object described as some JSON string to JavaScript function and I have to look for a workaround like preparing a JSON string as java.lang.String
argument in Java and then parsing it in JavaScript function to get a plain JavaScript object?