indexSearch.jsp
1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<%@page pageEncoding="UTF-8"%>
<%
String contextPath = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+contextPath+"/";
%>
<div class="div-search" id="divSearchContent" style="display:none;border: none">
<input class="text-search" id="txtSearch" type="text" placeholder="搜 索" style="text-indent:6px"/>
<input id="searchType" value="" style=" display: none; "/>
<div onclick="search()" id="searchbtn" class="div-search-searchbtn">
<img src="<%=basePath%>image/index/icon-search.png" width="19" height="19" />
</div>
</div>
<jsp:include page="offline.jsp"></jsp:include>
<script type="text/javascript">
var global = global || {};
global = global || {};
global.basePath = '<%=basePath%>';
global.contextPath = '<%=contextPath%>';
//回车搜索
$('#txtSearch').keydown(function(e){
if(e.keyCode==13){
search();
return false;
}
});
function search(){
var text = $('#txtSearch').val();
var type = $('#searchType').val();
if(!text){
return layer.msg("请输入查询字段!");
}
console.log(text);
var _url = CONF_FRONT_SERVERURL+'/view/search-list.jsp?text='+encodeURI(encodeURI(text));
if(type){
_url += "&type="+type
}
window.open(handleJumpUrl(_url));
}
</script>