如何放置 selectItem 变量:
var e = document.getElementById("categoryName");
var selectItem = e.options[e.selectedIndex].text;
在:
var theData = [ // Start of JavaScript data object
<%
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/pyramid", "root", "test");
PreparedStatement ps = con.prepareStatement("SELECT timeStamp, value FROM status WHERE idCategory = (SELECT idCategory FROM category WHERE name =' " SELECTITEMVARIABLE " ')");
在它说 SELECTITEMVARIABLE 的 prepearedstatement 中,我如何使用 javascript 中的 selectItem?抱歉英语不好,谢谢!