java側
String num="234234";URL url1 = getClass().getResource("/html/imGroupVar.html");webview.getEngine().load(url1.toExternalForm() + "?cc=" + num);
本地html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>GroupCall</title>
</head>
<body>
1111
<script src="xx.js"></script>
<script>//獲取傳入的cc參數alert(getCCParameter())function getCCParameter() {// 創建URLSearchParams實例,傳入當前URL的查詢字符串const params = new URLSearchParams(window.location.search);// 獲取cc參數的值const ccValue = params.get('cc');return ccValue;
}</script>
</body>
</html>