谁能帮我解决我的jsp代码的简单问题?这是我的带有 JavaScript 的 jsp 页面
function fid()
{
var id=document.getElementById("id").value;
alert(id);
<%
String demo=id; // store id value of java script but not working
or find(id); // or call a function with parameter of java script var value
// both are not working
%>
}
这是我的html页面——
Enter Student Id<input type='text' id='id'><button type='button' onclick='fid()'>Find</button>
如何在 jsp 函数中传递 js 值。
我知道我可以用 ajax 或 jquery 做到这一点,但我不知道这些语言。欢迎任何建议或代码片段。