在我的一個java項目中,需要在數據列表的上面添加過濾功能,可且根據用戶選擇的過濾條件,來生成不同過濾腳本:
//**********************以下是表格的第一行腳本***************************//
<TD align="center" width="15%" height="25">選擇查詢條件:</TD>
<TD align="left" width="30%"><select name="FilterName" id="FilterName"
style="width:100%" onchange="javascript:changeFilter();">
<option value=""></option>
<option value='BugInfo_Title' <%=BugInfoList.getSelected("BugInfo_Title")%>>Bug標題</option>
<option value='BugInfo_BugUser' <%=BugInfoList.getSelected("BugInfo_BugUser")%>>安裝用戶</option>
<option value='BugInfo_BugSystem' <%=BugInfoList.getSelected("BugInfo_BugSystem")%>>安裝系統</option>
<option value='BugInfo_BugTime' <%=BugInfoList.getSelected("BugInfo_BugTime")%>>提交時間</option>
<option value='BugInfo_DoneTime' <%=BugInfoList.getSelected("BugInfo_DoneTime")%>>完成時間</option>
</select></TD>
<TD align="left" width="37%" id="filter"><%=BugInfoList.getFilterHtml()%></TD>
<TD align="center" width="18%"><A class="TextUrl9" href="javascript:doFilter();">
<IMG src="../images/image/chaxun.gif" align="absMiddle" border="0">開始過濾</A>
<A class="TextUrl9" href="javascript:doAll();"><IMG
src="../images/image/cx.gif" align="absMiddle" border="0">全部</A>
</TD>
</TR>
//*********************************以下是JavaScript腳本******************************************************//
/*獲取客戶端XMLHttpRequest請求對象*/
function getRequest(){
var request = false;
try {
request = new XMLHttpRequest();
} catch (trymicrosoft) {
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
request = false;
}
}
}
if (!request) alert(