File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Javascript functions breaking when calling Java methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Javascript functions breaking when calling Java methods" Watch "Javascript functions breaking when calling Java methods" New topic
Author

Javascript functions breaking when calling Java methods

Kyle Kemp
Greenhorn

Joined: Dec 30, 2010
Posts: 3
Hello,
I am trying to get JavaScript to call some Java functions (the functions in question are run via an applet), but for some reason, every time I try to call a method, the JavaScript just ceases execution as if nothing happened. I've checked, and am getting no errors (which is the reason I'm here instead of google.. spent an hour on google to no avail), so I'm not sure what's up. Here's my Java code (it's pretty simple):

And here's my HTML page, trying to get it to work (this is only one of the many things I've tried, I think I'm doing it wrong here..):


Any help would be appreciated, thanks!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18655
    
    8

Have you debugged the applet to see if that method is being called?
Kyle Kemp
Greenhorn

Joined: Dec 30, 2010
Posts: 3
I have tried. I know it is functional from within the Java interface. And it's trying to be called from the JS interface, it just stops when it tries to call the applet portion. I've found it is actually causing an error, through someone else taking a look and debugging it as well. It's being called, but it's being shot down. I've also found out that it's giving me a "TypeError: Object # has no method 'requestX'. I looked into this a bit more (now that I finally got an error message), and apparently Chrome does not support LiveConnect because of something called NPRuntime, which I am now trying to look into, and figure out a way to use that instead.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript functions breaking when calling Java methods