现在有一个login.html登录页面,经一个JSP验证用户信息后,如果用户不存在,返回给login.html一个参数值,让login.html里隐藏的标签(如提醒用户错误的Label)显示出来。还有,在login.html里怎么获得这个值。菜鸟一个,能不能说得详细点。
------解决方案--------------------
也可以用参数 error.html?msg=<%=URLEncoder.encode("用户或密码错误") %>
<script>var param = window.location.search.substring(window.location.href.indexOf("?msg=") + 4);</script>