0

I have a JavaFX application with a WebView that loads a local HTML page. That works fine. However, I would like that HTML page to include a script that references an external JavaScript file such that those functions can then be invoked by my JavaFX application to update the displayed Web page. I have found the Oracle tutorial, but it uses a script embedded inside the HTML page where I'd like to use an external JS file. Also, can my HTML file invoke a script when it's loaded?

I can call JavaScript functions if they are declared inside the HTML file, but how can I use an external JavaScript file?

AudioElf
  • 11
  • 1
  • Yes, a WebView can use [html files that reference external script files](https://stackoverflow.com/questions/11498068/how-to-use-external-js-files), and yes, such a script can be [executed on page load](https://stackoverflow.com/questions/807878/how-to-make-javascript-execute-after-page-load). If you can't get it to work, provide a [mcve] of your attempt. – jewelsea Nov 20 '22 at 07:55

0 Answers0