Forum How do I...?

enable javascript from java wrapper?

randallxski
I've found information on enabling javascript from the command line, but not from the java wrapper. What's the best way to enable javascript from java?

Thanks!
mikeday
It appears we need to add a method to the Java wrapper to enable JavaScript, we will do this shortly.
randallxski
Okay, thanks. JavaScript would be really helpful for one tweak that would really improve the user experience.

Speaking of the Java Wrapper, the API link on the web site isn't working on: http://princexml.com/doc/8.1/java/. The API documentation is included in the download.
mikeday
Today we have released an updated version of the Prince Java wrapper that includes a setJavaScript() method and other improvements. The broken link to the API documentation has also been fixed.
randallxski
Thanks for the quick turn-around on that. It works great for HTML. Now that it's available, I'm not quite sure how to implement a solution for XML. What options do I have for loading a JavaScript function that could then be accessed in the CSS?
mikeday
You can put functions in an external script file that gets applied with addScript(), corresponding to the --script option on the command-line.
randallxski
Thanks for your help, Mike. Sorry I missed addScript(). Implementing it went perfectly. I was able to get all the other information I needed in the JavaScript from the DOM.