ram muna wrote:
>
> Hi All,
>        I am sorry for asking this fundamental
> question, but I have found this import statement in
> one of our java files
>
> import netscape.javascript.JSObject,
>
>       I tried going to netscape site and do research
> on this topic, but was not successful. Can any body
> help me with what this function, is and where can I
> find more about this,

It's part of LiveConnect, Netscape's Java/JavaScript communication
stuff. See Chapter 14 of the JavaScript Reference at

http://developer.netscape.com/docs/manuals/communicator/jsref/index.htm

or search for LiveConnect on the developer site
(developer.netscape.com).

A JSObject is the Java type used when you want to pass a JavaScript
object to or from a Java method. For example, you can have a JavaScript
object:

// JavaScript

function anInfoObject()
{
    this.name = "";
    this.city = "";
}

var info = new anInfoObject()
var javaClass = new Packages.aClass()
javaClass.set_fields(info)


and initialize it in Java:

// Java

public aClass {
public void set_fields(JSObject info) {
    info.setMember("name", "A Name");
    info.setMember("city", "A City");
}
}


Of course, your Java class will usually do something more interesting
than this.

(The syntax may be off; I haven't used this in a while.)

Gennis

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to