我的 java Fx webview 为以下代码引发 JS 异常。谁能解释我为什么?
WebView webview = new WebView();
WebEngine webengine=webview.getEngine();
newtab.setText("Start Page");
newtab.setContent(webview);
editTabset.getTabs().add(newtab);
webengine.load("file:///E:/myproj/src/novuseditor/resources/html/clike.html");/*works till here*/
webengine.executeScript("document.getElementById('code').value=\"Hi\"");
/*exception:netscape.javascript.JSException: TypeError: 'null' is not an object */