1、JS
if (typeof (lastBookID) == "undefined") {
alert("undefined---");
}1、JSP
<%
String bookId = request.getParameter("bookId");
if (null != bookId && !"undefined".equalsIgnoreCase(bookId)) {
session.setAttribute("bookId", bookId);
}
%>