0

I am looking to write my first Java applet (with a difference). I want to write an applet that manipulates the DOM of the page in which the applet is placed. A suitable example would show how:

  1. an element can be retrieved from the DOM (by name, id or some other CSS property)
  2. Insertion/deletion of an element in to the DOM (before/after) a given DOM element
  3. the innerHTML of a DOM element can be changed

  4. Call a javascript function and pass data from the Java applet, to the javascript function

I have searched the internet - but so far, have not come accross any such example. Is anyone aware of such an example?. If yes, please post a link, or a snippet that shows how to achieve the functionality listed above, if possible.

PleaseStand
  • 31,641
  • 6
  • 68
  • 95
skyeagle
  • 6,925
  • 16
  • 56
  • 71

2 Answers2

0

I'd suggest that you just solve 4 and use JavaScript to do you DOM manipulation. See JSObject

Paul M
  • 357
  • 1
  • 8
0

www.java2s.com is alsways a good starting point to look for examples.

http://www.java2s.com/Code/JavaScript/Development/UsingJavaScriptinanApplet.htm

PeterMmm
  • 24,152
  • 13
  • 73
  • 111