您的位置:首页 > Web前端 > JavaScript

jsp页面显示效果

2013-11-03 17:40 274 查看

1输入框提示信息

<input type="text" value="请输入帐号" onmouseover=" this.value='' ">


<input type="text" onfocus="this.value='';" onblur="if(this.value=='')this.value='默认显示的字';
" value="默认显示的字" name="sousuo" size="24" class="lb_search" />

<script language="javascript" type="text/javascript">
var d1 = document.getElementById('d1');
function show()
{
d1.style.display = 'block';
}
function hidden()
{
d1.style.display = 'none';
}
</script>
<body>
<p>asdfasdfasdfsdfdfg<a href="#" onmouseover="show()" onmouseout="hidden()">鼠标放上来看看</a>sdfhdfh</p>
<div id="d1"></div>
</body>

2针对不断刷新页面,用来对按钮变色

 <%
                       UserManagerService userManagerService = new UserManagerService();
                       ResultSet functionlist = userManagerService.queryFunctions(user); /* 根据用户名进行查询所有菜单*/
                       String flag=request.getParameter("flag");
                       System.out.println(flag);
                       while(functionlist.next()){
                           String  functionUrl = functionlist.getString("FUNCTION_URL").trim();
                           String  functionName = functionlist.getString("FUNCTION_NAME");
                           int id = functionlist.getInt("FUNCTION_ID");
                          
                         %>
                        
<h1><a href="${pageContext.request.contextPath}/<%= functionUrl%>?flag=<%=id %>" style='<%= flag!= null &&
!"".equals(flag) && id==Integer.parseInt(flag)?"color:yellow;":"" %>' >  <%=functionName %>  </a></h1>

因为有可能会出现乱码,所以用id来传参数
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: