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>