Skip to main content

accesing DOM elements in brower

2 replies [Last post]
moldoe
Offline
Joined: 2004-12-21
Points: 0

In release 0.9 I've seen the folowing statement:
"New Browser APIs supporting DOM/javascript execution support". What does it mean the DOM part? In fact my question is if it is posible to access DOM elements of the current html page loaded in the browser. For example I want to get a list with all elements named "a" and read their attributes. Do you have in your plans to expose such API?

Thanks,

Daniel

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
georgez
Offline
Joined: 2003-08-19
Points: 0

Hi Daniel,

For implementation constraits, we didn't provide the fine-grained DOM API support directly:
http://weblogs.java.net/blog/georgez/archive/2005/03/wheres_jdic_goi.html

But you can use the DOM API via Javascript with below method:
https://jdic.dev.java.net/nonav/documentation/javadoc/0.9/org/jdesktop/jdic/browser/WebBrowser.html#executeScript(java.lang.String)

Hope it helps.

Thanks,
-George.

moldoe
Offline
Joined: 2004-12-21
Points: 0

Let's suppose I call executeScript("function_name") where function_name is the name of a js function from my page and this function will return an Array of DOM elements. What will contain the return value of the executeScript() method? It's only a String...

Thanks,

Daniel