搜索显示结果页面~~~记录下

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" isELIgnored="false" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script>
 
</script>
<title>show.jsp的标题</title>
</head>
<body>
  <h3>以下是搜索到的关键字:<font style = "color:red" id = "key">${key}</font></h3>
  <h4>总共搜索到<span style = "color:red">${map.linkCount}</span>个链接,复合条件的链接有<span style = "color:red">${map.count}</span>个</h4>
  <h5>点击<a href = "${url}"><span style = "color:red">这里</span></a>进入该页面</h5>
 <ul>
 <c:forEach var = "linkValue" items="${map.list}">
 <script>
   var lv = '${linkValue.linkValue}';
   var key = '${key}';
 
     if(lv.indexOf(key)>0){
       var hightlight = '<span style = "color:red">'+lv.substring(lv.indexOf(key),(lv.indexOf(key)+key.length))+'</span>';
       var headValue = lv.substring(0,lv.indexOf(key));
       var lastValue = lv.substring((lv.indexOf(key)+key.length),lv.length);
       document.write('<li><a href = "${linkValue.aLink}">'+headValue+hightlight+lastValue+'</a></li>');
     }else{
        var hightlight = '<span style = "color:red">'+lv.substring(lv.indexOf(key),key.length)+'</span>';
       var lastValue = lv.substring(key.length,lv.length);
       document.write('<li><a href = "${linkValue.aLink}">'+hightlight+lastValue+'</a></li>');
     }
 </script>
 
 </c:forEach>
 </ul>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值