Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. Problem with JSObject

Problem with JSObject

Scheduled Pinned Locked Moved Java
helpcsharpc++javajavascript
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raesa
    wrote on last edited by
    #1

    Hi, I have written a small code to access javascript function from a java applet. My function fails at this point JSObject win = JSObject.getWindow(this); I do not understand what is the reason.It gives me following errors when i excute the program : Exception in thread "main" java.lang.UnsatisfiedLinkError: initClass at netscape.javascript.JSObject.initClass(Native Method) at netscape.javascript.JSObject.<clinit>(JSObject.java:61) at test.InJava4.start(InJava4.java:52) at test.Main.main(Main.java:30) Please have a look at my code written below and tell me if i have written anything wrong.Please do help me out. Thnx. My java Applet code is written below : import java.net.*; import java.applet.*; import netscape.javascript.*; import netscape.javascript.JSException; public class InJava extends java.applet.Applet { public void init() { try { System.out.println("hi i am in appltet"); String msg = "Hello from Java (using javascript alert)"; JSObject win = JSObject.getWindow(this); win.call ("doAlert", null); } catch (Exception Ex) { System.out.println(Ex.toString()); } } public void start(){} public void stop(){} public void destroy(){} } My JavaScript is written below : ; function doAlert(s) { alert(s); }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups