当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Java Applet from Oracle example says "applet.function is not a function"

问题描述:

I'm trying to run Java Applet from this Oracle example for invoking applet's methods from Javascript. I have not made any changes to it. When js invokes applet's function, nothing happened but the error occures in js console saying mathApplet.getGreeting is not a function (in Firefox). This does not works in Chrome too. This is my first time I'm dealing with Java so I could miss something important. I'm using Intellij Idea.

网友答案:

actually, there were two errors - first, I forgot to place .jnlp file on the right place, and second (this is pretty strange), which I got after modifying code a bit - document.writeln("...") before invocation of applet's function causes applet not to work.

分享给朋友:
您可能感兴趣的文章:
随机阅读: