简体   繁体   English

如何处理Java小程序网页的DOM

[英]How to manipulate DOM of Java applet's web page

I'd like to modify the value of a hidden <input> tag in my applet. 我想修改小程序中隐藏的<input>标记的值。 But I don't know how to manipulate DOM elements. 但是我不知道如何操作DOM元素。

I've found the article "Manipulating DOM of Applet's Web Page" in official Java SE tutorial. 我在官方Java SE教程中找到了文章“操纵Applet的Web DOM”。 But when I try the following code : Class c = Class.forName("com.sun.java.browser.plugin2.DOM"); 但是,当我尝试以下代码时: Class c = Class.forName("com.sun.java.browser.plugin2.DOM"); I get a ClassNotFoundException . 我得到一个ClassNotFoundException

Is the Java Common DOM API is installed with JDK ? JDK是否安装了Java Common DOM API? It only supports special browsers ? 它仅支持特殊的浏览器吗? Or we should use an other API ? 还是我们应该使用其他API?

I'm using JDK 7, browser Google Chrome and Eclipse for programming. 我正在使用JDK 7,浏览器Google Chrome和Eclipse进行编程。

Best regards 最好的祝福

You are better off abstracting the DOM manipulation out to JS, since there are JS APIs that take cross-browser differences into account. 最好将DOM操作抽象到JS,因为有些JS API考虑了跨浏览器的差异。 Then have the applet call the generic JS methods. 然后让applet调用通用JS方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM