Netscape.javascript.JSObject without applets - Urgent!

Hi,
I need to evaluate some Javascript expressions inside my java code... BUT my code is not inside an Applet class. Does anyone know how to do it?
I chose to use the netscape.javascript package, it work well inside an applet.. but my application doesn't run inside an applet. When I try to run it inside a standalone application it fails (even if the application extends from the Applet class).
Here is part of the code:
public class Applet1 extends Applet {
public void init() {
try {
String out;
JSObject win = JSObject.getWindow(this);
out=win.eval("2+3;").toString();
jLabel1.setText(out);
System.out.print(out);
public static void main(String[] args){
Applet1 app=new Applet1();
app.init();
The code runs perfect inside Internet explorer, but it crashes when running in standalone mode.
Thanks.

I need to evaluate some Javascript expressions inside
my java code... BUT my code is not inside an Applet
class. Does anyone know how to do it?Haven't actually used it, but Mozilla has the Rhino JavaScript interpreter:
http://www.mozilla.org/rhino/
Also you could Google for FESI, which is an ECMAScript interpreter (basicly an early version of JavaScript that went through the standards process).

Similar Messages

  • Where i can find the package "netscape.javascript.JSObject;" ??urgent

    where i can find the package "netscape.javascript.JSObject;" ??urgent
    please

    The Java Plug-in 1.3 ships netscape.javascript in a JAR file called JAWS.JAR. To compile an applet which uses JSObject, just add JAWS.JAR in the CLASSPATH before compilation.
    If you don't have the Plug-in, but do have a Netscape browser installed, you can add the java40.jar file that comes with Communicator to the end of your CLASSPATH (or extract the netscape.* classes from there).

  • JSObject WITHOUT Applet - Urgent!

    Hi,
    I need to evaluate some Javascript expressions inside my java code... BUT my code is not inside an Applet class. Does anyone know how to do it?
    I chose to use the netscape.javascript package, it work well inside an applet.. but my application doesn't run inside an applet. When I try to run it inside a standalone application it fails (even if the application extends from the Applet class).
    Here is part of the code:
    public class Applet1 extends Applet {
    public void init() {
    try {
    String out;
    JSObject win = JSObject.getWindow(this);
    out=win.eval("2+3;").toString();
    jLabel1.setText(out);
    System.out.print(out);
    public static void main(String[] args){
    Applet1 app=new Applet1();
    app.init();
    The code runs perfect inside Internet explorer, but it crashes when running in standalone mode.
    Thanks.

    Sounds like you want to embed a javascript interpreter in your java application. Try something like:
    http://www.mozilla.org/rhino/index.html

  • Appletviewer: java.lang.NoClassDefFoundError: netscape/javascript/JSObject

    When I run the appletviewer: in trying to dedebug what the Java plugin fails to load I get this error:
    C:\Program Files\Java\jdk1.5.0_01\bin>appletviewer.exe http://www.java.com/en/
    java.lang.NoClassDefFoundError: netscape/javascript/JSObject
    at JavaCallJS.init(JavaCallJS.java:21)
    at sun.applet.AppletPanel.run(AppletPanel.java:373)
    at java.lang.Thread.run(Thread.java:595)
    Thanks!
    John

    Hi,
    Can you elaborate on your problem ? Also if you are using the netlet, please provide complete java console output
    Thanks!
    Satish

  • MyApplet.java:2: Class netscape.javascript.JSObject not found in import.

    Hi,
    Im getting: MyApplet.java:2: Class netscape.javascript.JSObject not found in import.
    import netscape.javascript.JSObject;
    Where can i get this package. Someone said jaws.jar, but its not to be found. Im new on this project and I dont know how the old people compiled this applet.
    JDK version is:
    Solaris VM (build Solaris_JDK_1.2.2_10, native threads, sunwjit)
    Thanks

    Thanks man!
    I installed the jdk1.4 on my workstation. I then compiled the program via JDeveloper and pumped the class over to my server.
    Thanks again.

  • Cannot Resolve Symbol  netscape.javascript.JSObject

    I am trying to communicate fom an applet to a javascript. I am usinjg jdk1.3.1 and did an import netscape.javascript.JSObject; in my applet class.
    When I compile I get cannot resolve symbol JSObject. The import does not seem to work.
    Do I have to download the package from somewhere and put it in the jdk1.3.1 dir in some place?
    Thanks

    Ive netscape 7.1 and the JSDK 1.4.2. The Java40.Jar doesnt seem to be present in my netscape folder anywhere so I assume that it isnt included in the newest version of netscape.
    I tried using the javaws.jar that came with my JSDK but it didnt work. I opened it up and searched it and saw no mention of a JSObject file.
    Im a little confused at this point. Where can I look up the location of the JSObject?

  • Ava.lang.ClassNotFoundException: netscape.javascript.JSObject

    Im not using netscape, why this error!!!!
    Help!
    java.lang.ClassNotFoundException: netscape.javascript.JSObject
         at com/ms/vm/loader/URLClassLoader.loadClass
         at java/lang/ClassLoader.loadClassInternal
         at com/sco/tta/client/portal/Mediator.init
         at com/ms/applet/AppletPanel.securedCall0
         at com/ms/applet/AppletPanel.securedCall
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.processSentEvent
         at com/ms/applet/AppletPanel.run
         at java/lang/Thread.run

    Hi,
    Can you elaborate on your problem ? Also if you are using the netlet, please provide complete java console output
    Thanks!
    Satish

  • Where to download netscape.javascript.JSObject?

    I have this statement in my Java program
    import netscape.javascript.JSObject , and when i cannot compile. May I know where I can download this package?

    Hi,
    Check out below links, i hope it will help you.
    http://docs.iplanet.com/docs/manuals/js/server/jsref/lcjsobj.htm
    http://www.netscape.com/eng/mozilla/3.0/handbook/javascript/packages.htm#1007459
    http://www.mozilla.org/oji/MRJPlugin.html
    http://developer.netscape.com/docs/technote/javascript/liveconnect/liveconnect_rh.html
    http://www.innovation.ch/java/HTTPClient/disp_html.html
    Thanks,
    Dakshin.

  • Import netscape.javascript.JSObject;

    import netscape.javascript.JSObject;
    This library is deprecated? In this case. Can I replace it with another solution?
    Thanks.

    Not sure. First, I am not sure why you think JSObject is deprecated. After all the link I gave you is for Java 6.
    DOM seems to be more official and the way to go in the future, but they say only IE and Mozilla seem to support it.

  • Netscape.javascript.JSObject outside an applet class

    Hi,
    I need to evaluate some Javascript expressions inside my java code... BUT my code is not inside an Applet class. Does anyone know how to do it?
    I chose to use the netscape.javascript package, it work well inside an applet.. but my application doesn't run inside an applet. When I try to run it inside a standalone application it fails (even if the application extends from the Applet class).
    Here is part of the code:
    public class Applet1 extends Applet {
    public void init() {
    try {
    String out;
    JSObject win = JSObject.getWindow(this);
    out=win.eval("2+3;").toString();
    jLabel1.setText(out);
    System.out.print(out);
    public static void main(String[] args){
    Applet1 app=new Applet1();
    app.init();
    The code runs perfect inside Internet explorer, but it crashes when running in standalone mode.
    Thanks.

    You can also use Rhino to execute JavaScript
    http://www.mozilla.org/rhino/

  • Netscape.javascript.JSObject for mac

    I have the latest NetBeans version for mac os 10.5.
    What do I need to do to get access to the netscape.javascript package.
    I am trying to read cookies written using php into an applet. I am also open to solutions that do not need netscape.javascript.
    I am a beginner to the mac os so I am unable to translate the many solutions that appear to be for windows users. Apparently all I need to do is add Plugins.jar to my classpath, but I cannot find Plugins.jar, (or java40.jar or JAWS.JAR which apparently contained these packages in various releases), none of which I can find on my mac or available for download.
    I am sure this is very simple but I am running out of hair to pull out.

    I believe that for Mac, the required jar can be called plugin.jar or netscape.jar.
    Its location is somewhere around */System/Library/Frameworks/JavaVM.framework/Versions/<your version>/Home/lib*
    I don't have a Mac so I can't verify this , sorry.
    Good luck.

  • Netscape.javascript.JSObject

    hi all
    where do i download the package
    netscape.javascript
    which extends java.lang.Object
    regards
    Pradheep

    You have two options
    1. domwload the rhino.jar from http://www.mozilla.org/rhino/download/
    or set your classpath to use the jre library 1.3 version or later, beacuse the jaws.jar insede the virtual machine contains the javascript object
    i hpoe helps to you
    [email protected]

  • Linux Version of netscape.javascript.JSObject(jaws.jar)

    Whats the linux for java version of jaws.jar and where does this reside under jdk installation for linux?
    We need to include it in classpath before compiling our app in linux.
    Thanks

    http://developer.java.sun.com/developer/JDCTechTips/2002/tt0219.html
    Look for javaplugin.jar instead.

  • Solaris 10 Netscape, Java , (Javascript) JSObject  Issue.

    Hi all,
    I am migrating the source code from solaris 8 wtih CC compiler 4.2 to solaris 10 cc compiler 5.7 on x86 Machine. Most of Problems i got solution from C++ forum so i almost through. But while building one directory that contains some java Applets i got issues:-
    1. Since its using
    import netscape.javascript.JSObject; so it was not getting this JSObject on the latest Solaris 10 Machine. what i did i copied the /outils/netscape/solaris/java_301on solaris 10 Machine from solaris 7 Machine. then i build it again. every thing got build successfully and generated Input.class file but again it gave me following message
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    then i tried with -Xlint option and it again bounce me some errors.
    So question here is that on Solaris 10 is there any thing else that i can use for Java Script i.e JSObject if there is no netscape i.e whats the default browser mozillla or netscape. and why java_301 is used and what will happend if i try something else other than java_301. as it was using
    -classpath = /outils/netscape/solaris/java_301
    while doing javac compiling. and other thing i see is
    -classpath /usr/java/lib/classes.zip
    but when i see version of java on solaris 10 there is no classes.zip. whats the use of this.??
    and when i used -Xlint it bounce error with classes.zip not found.

    This forum is about using Sun C++. Your question is about Java. You are more likely to get a helpful answer in java forum.
    Try the java forum:
    http://forum.sun.com/forum.jspa?forumID=8

  • Netscape.javascript.JSException is never thrown in body of corresponding tr

    I have the following try/catch block:
    try
              netscape.javascript.JSObject.getWindow(this.applet).eval("ClkExcept(" + nId.toString() + ")");
            }catch(netscape.javascript.JSException e){}Which, for as long as I have compiled (until recently) compiled fine. However, when I recently had to recompile the classes containing this code because of an unrelated issue, I now get a message from the compiler stating that exception netscape.javascript.JSException is never thrown in body of corresponding try statement. I am attempting to use the latest 1.3.1_XX SDK (I must compile with some build of 1.3.1), but have run into this compiler message with all builds of 1.3.1 that I have tried. All documentation I can locate for the netscape.javascript.JSObject class states that the GetWindow() function can throw an exception of type netscape.javascript.JSException.
    Has anyone seen this before, or does anyone have any suggestions on how to get the compiler working correctly?

    This code has not been edited in two years, but has
    been recompiled numerous times since then (until
    today) without any compiler messages pertaining to
    this try/catch block. I know for a fact that the
    GetWindow() function can throw a JSException. Have you changed compilers recently?
    Have you tried compiling a brand new tiny test program in a different directory, with an explicit -classpath arg that contains only that relevant jar file, and no other classes in the directory?
    Have you tried extracting the class file from the jar, running it through a decompiler, and seeing what it says about the exception?
    If I
    remove the try/catch block and there is a problem
    with the javascript function that is called on the
    page hosting my applet there would obviously be an
    exception to catch. Removing the try/catch block is
    not a solution.You could try catching Exception instead. That will pass the compiler, because Exception includes RuntimeException and its descendants, and the compiler can't know that those won't be thrown, since they're unhecked. I'd consider that a last-ditch hack though, and wouldn't do it unless I'd thoroughly investigated first.

Maybe you are looking for

  • [UIX] How To: Return multiple values from a LOV

    Hi gang I've been receiving a number of queries via email on how to return multiple items from a LOV using UIX thanks to earlier posts of mine on OTN. I'm unfortunately aware my previous posts on this are not that clear thanks to the nature of the fo

  • SOAP Exception in JWSDP1.2

    Hi, We are using jtomcat4.1 and j2sdk1.4.2_01 with jwsdp1.2 to access a webservice using JSP. When SOAP Exception has to be thrown from the WebService, We are getting, "java.rmi.RemoteException: Runtime exception; nested exception is: trailing block

  • Recommendations for an iPhone 3G signal amplifier or antenna??

    My new iPhone 3G happens to be getting 1/2 of a bar worth of cellular signal (on the 3G network) in the same place my old iPhone got a full signal when it was using the Edge network?? I've confirmed that this is due to an apparent lack of 3G coverage

  • Payment to Vendor

    Hi, Purchase Order has created for 1000 USD and Goods receipt has done. Invoice is created and Payment has been done to Vendor. After that Vendor has send one more Invoice for 200 USD because of  the material price has increased and our management ha

  • Filenames in iPhoto

    Is it true that there is no method for safely editing a photo's filename once the photo has been imported into iPhoto? By "safely", I mean without corrupting the iPhoto library. Also, if I delete a photo in iPhoto, is it completely deleted from the h