firefox上的问题? keyword.value sort.value filter.value的关系吧改成类似document.getELementById("keyword").value应该就可以了没装ff,没有把握 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 感谢回复!但还是不行,在FIREFOX上点按钮一点反映都没有。 直接用document.location.href="http://www.never-online.net"类似的网站,看看能否执行?如果可以,那么'/MyGroupsShow.do?gid=<%=gid%>&page=1&keyword='+keyword.value+'&sort='+sort.value+'&filter='+filter.value+'#groupsearch'你的sort.value和filter.value是否是直接用ID作为引用的?是的话请改为用document.getElementById等DOM方法获取该对象这个字符串的全部内容是什么?看是否先需要编码 用document.getElementById也不行啊,还是没反映。 有道理有特殊字符用escape(...)编码比较有保障就是服务器读取时解码麻烦了一些 应该就是:keyword='+keyword.value+'&sort='+sort.value+'&filter='+filter.value这的问题,去掉它们就可以了,但应该怎么改呢?用document.getElementById也不行啊,还是没反映。 在IE下正常执行的是这样的:http://localhost:8080/site/MyGroupsShow.do?gid=32&page=1&keyword=test&sort=null&filter=null#groupsearch搜索关键字是test 没有FORM,是在一个TABLE里:<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="FFF2CF"> <tr> <td width="22%" align="left" valign="middle"><select name="filter" id="filter" size="1" onChange="if (this.options[this.selectedIndex].value!=null){location='<%=Config.getWebContextRoot()%>/MyGroupsShow.do?gid=<%=gid%>&page=1&keyword=<%=keyword%>&sort='+sort.value+'&filter='+this.options[this.selectedIndex].value+'#groupsearch'}"> <option value="null" <%if(filter.equals("null")){out.print("selected");}%>> Show All Grades </option> <logic:iterate id="levelresults" name="levelresults" scope="request"> <bean:define id="levelresults" name="levelresults" type="java.lang.String" /> <option value="<%=levelresults%>" <%if(filter.equals(levelresults)){out.print("selected");}%>> <bean:write name="levelresults" /> </option> </logic:iterate> </select> </td> <td width="13%" height="30" align="right" valign="middle"><div align="center"> page <%=pagenum%> of <%=pagecount%> </div></td> <td width="41%" align="center" valign="middle"><INPUT style="BORDER-RIGHT: #3399cc 1px solid; BORDER-TOP: #3399cc 1px solid; FONT-WEIGHT: normal; FONT-SIZE: 10pt; BORDER-LEFT: #3399cc 1px solid; COLOR: #3399cc; BORDER-BOTTOM: #3399cc 1px solid; FONT-FAMILY: Arial" size=21 name=keyword value='<%=keyword%>' id="keyword" onClick="javascript:this.value='';"> <INPUT name="button" type="button" class=button onmouseover="this.className='buttonHover';" onmouseout="this.className='button';" value=" GO " onclick="location='<%=Config.getWebContextRoot()%>/MyGroupsShow.do?gid=<%=gid%>&page=1&keyword='+document.getELementById("keyword").value+'&sort='+document.getELementById("sort").value+'&filter='+document.getELementById("filter").value+'#groupsearch'"> </td> <td width="24%" align="right" valign="middle"><select name="sort" id="sort" onChange="if (this.options[this.selectedIndex].value!=null){location='<%=Config.getWebContextRoot()%>/MyGroupsShow.do?gid=<%=gid%>&page=1&keyword=<%=keyword%>&sort='+this.options[this.selectedIndex].value+'&filter='+filter.value+'#groupsearch'}"> <option value="null" <%if(sort.equals("null")){out.print("selected");}%>> Sort By Relevance </option> <option value="0" <%if(sort.equals("0")){out.print("selected");}%>> Sort By Creation Date </option> <option value="1" <%if(sort.equals("1")){out.print("selected");}%>> Sort By Author </option> <option value="2" <%if(sort.equals("2")){out.print("selected");}%>> Sort By Title </option> </select> </td> </tr> </table> <INPUT name="button" type="button" class=button onmouseover="this.className='buttonHover';" onmouseout="this.className='button';" value=" GO " onclick="location='/site/MyGroupsShow.do?gid=32&page=1&keyword='+document.getELementById("keyword").value+'&sort='+document.getELementById("sort").value+'&filter='+document.getELementById("filter").value+'#groupsearch'"> </td> <td width="24%" align="right" valign="middle"><select name="sort" id="sort" onChange="if (this.options[this.selectedIndex].value!=null){location='/site/MyGroupsShow.do?gid=32&page=1&keyword=Search Group Resources&sort='+this.options[this.selectedIndex].value+'&filter='+filter.value+'#groupsearch'}"> onclick="location='/site/MyGroupsShow.do?gid=32&page=1&keyword='+document.getELementById('keyword').value+'&sort='+document.getELementById('sort').value+'&filter='+document.getELementById('filter').value+'#groupsearch'"> <script type="text/javascript">//<![CDATA[function foo() {var sortVal = document.getElementById("sort").value;var keyVal = document.getElementById("keyword").value;var filterVal = document.getElementById("filter").value;var locationUrl = '/site/MyGroupsShow.do?gid=32&page=1&keyword='+keyVal+'&sort='+sortVal+'&filter='+filterVal+'#groupsearch'alert(locationUrl);location.href=locationUrl;}//]]></script><input id="keyword"/><input id="filter"/><INPUT name="button" type="button" value=" GO " onclick="foo();"> </td> <td width="24%" align="right" valign="middle"><select name="sort" id="sort" onChange="if (this.options[this.selectedIndex].value!=null){location='/site/MyGroupsShow.do?gid=32&page=1&keyword=Search Group Resources&sort='+this.options[this.selectedIndex].value+'&filter='+filter.value+'#groupsearch'}"> 你把document.getElementById写成了document.getELementById 那段function应该改成这样才对,因为sort是select控件。<script type="text/javascript">//<![CDATA[function foo() {var osort = document.getElementById("sort");var sortVal = osort.options[osort.selectedIndex].value;var keyVal = document.getElementById("keyword").value;var filterVal = document.getElementById("filter").value;var locationUrl = '/site/MyGroupsShow.do?gid=32&page=1&keyword='+keyVal+'&sort='+sortVal+'&filter='+filterVal+'#groupsearch'alert(locationUrl);location.href=locationUrl;}//]]></script> Java帮助文档下载地址 js怎样判断同一类型浏览器全部关闭 在什么设置? for循环变量问题 【菜鸟求助】为什么不能传递变量? 请教高手 半角和全角的判断? 高手指教: 如何判断子窗是否打开 请教高手!!(急急)通过javascript能够得到html中的页面的链接地址吗?在线苦等 如何获取ifram中的数据? 刷新问题 急!调用javascript后页面重新定位问题!!!
'/MyGroupsShow.do?gid=<%=gid%>&page=1&keyword='+keyword.value+'&sort='+sort.value+'&filter='+filter.value+'#groupsearch'
你的sort.value和filter.value是否是直接用ID作为引用的?是的话请改为用document.getElementById等DOM方法获取该对象这个字符串的全部内容是什么?看是否先需要编码
有特殊字符用escape(...)编码比较有保障就是服务器读取时解码麻烦了一些
这的问题,去掉它们就可以了,但应该怎么改呢?用document.getElementById也不行啊,还是没反映。
http://localhost:8080/site/MyGroupsShow.do?gid=32&page=1&keyword=test&sort=null&filter=null#groupsearch
搜索关键字是test
<table width="100%" border="0" align="center" cellpadding="0"
cellspacing="0" bgcolor="FFF2CF">
<tr>
<td width="22%" align="left" valign="middle"><select name="filter" id="filter" size="1" onChange="if (this.options[this.selectedIndex].value!=null){location='<%=Config.getWebContextRoot()%>/MyGroupsShow.do?gid=<%=gid%>&page=1&keyword=<%=keyword%>&sort='+sort.value+'&filter='+this.options[this.selectedIndex].value+'#groupsearch'}">
<option value="null"
<%if(filter.equals("null")){out.print("selected");}%>> Show All Grades </option>
<logic:iterate id="levelresults" name="levelresults"
scope="request"> <bean:define id="levelresults" name="levelresults"
type="java.lang.String" />
<option value="<%=levelresults%>"
<%if(filter.equals(levelresults)){out.print("selected");}%>> <bean:write name="levelresults" /> </option>
</logic:iterate>
</select>
</td>
<td width="13%" height="30" align="right" valign="middle"><div align="center"> page <%=pagenum%> of <%=pagecount%> </div></td>
<td width="41%" align="center" valign="middle"><INPUT style="BORDER-RIGHT: #3399cc 1px solid; BORDER-TOP: #3399cc 1px solid; FONT-WEIGHT: normal; FONT-SIZE: 10pt; BORDER-LEFT: #3399cc 1px solid; COLOR: #3399cc; BORDER-BOTTOM: #3399cc 1px solid; FONT-FAMILY: Arial" size=21 name=keyword value='<%=keyword%>' id="keyword" onClick="javascript:this.value='';">
<INPUT name="button" type="button" class=button
onmouseover="this.className='buttonHover';"
onmouseout="this.className='button';" value=" GO "
onclick="location='<%=Config.getWebContextRoot()%>/MyGroupsShow.do?gid=<%=gid%>&page=1&keyword='+document.getELementById("keyword").value+'&sort='+document.getELementById("sort").value+'&filter='+document.getELementById("filter").value+'#groupsearch'">
</td>
<td width="24%" align="right" valign="middle"><select name="sort" id="sort" onChange="if (this.options[this.selectedIndex].value!=null){location='<%=Config.getWebContextRoot()%>/MyGroupsShow.do?gid=<%=gid%>&page=1&keyword=<%=keyword%>&sort='+this.options[this.selectedIndex].value+'&filter='+filter.value+'#groupsearch'}">
<option value="null"
<%if(sort.equals("null")){out.print("selected");}%>> Sort By Relevance </option>
<option value="0"
<%if(sort.equals("0")){out.print("selected");}%>> Sort By Creation Date </option>
<option value="1"
<%if(sort.equals("1")){out.print("selected");}%>> Sort By Author </option>
<option value="2"
<%if(sort.equals("2")){out.print("selected");}%>> Sort By Title </option>
</select>
</td>
</tr>
</table>
onmouseover="this.className='buttonHover';"
onmouseout="this.className='button';" value=" GO "
onclick="location='/site/MyGroupsShow.do?gid=32&page=1&keyword='+document.getELementById("keyword").value+'&sort='+document.getELementById("sort").value+'&filter='+document.getELementById("filter").value+'#groupsearch'">
</td>
<td width="24%" align="right" valign="middle"><select name="sort" id="sort" onChange="if (this.options[this.selectedIndex].value!=null){location='/site/MyGroupsShow.do?gid=32&page=1&keyword=Search Group Resources&sort='+this.options[this.selectedIndex].value+'&filter='+filter.value+'#groupsearch'}">
//<![CDATA[
function foo() {
var sortVal = document.getElementById("sort").value;
var keyVal = document.getElementById("keyword").value;
var filterVal = document.getElementById("filter").value;
var locationUrl = '/site/MyGroupsShow.do?gid=32&page=1&keyword='+keyVal+'&sort='+sortVal+'&filter='+filterVal+'#groupsearch'
alert(locationUrl);
location.href=locationUrl;
}
//]]>
</script>
<input id="keyword"/>
<input id="filter"/>
<INPUT name="button" type="button" value=" GO " onclick="foo();">
</td>
<td width="24%" align="right" valign="middle"><select name="sort" id="sort" onChange="if (this.options[this.selectedIndex].value!=null){location='/site/MyGroupsShow.do?gid=32&page=1&keyword=Search Group Resources&sort='+this.options[this.selectedIndex].value+'&filter='+filter.value+'#groupsearch'}">
//<![CDATA[
function foo() {
var osort = document.getElementById("sort");
var sortVal = osort.options[osort.selectedIndex].value;
var keyVal = document.getElementById("keyword").value;
var filterVal = document.getElementById("filter").value;
var locationUrl = '/site/MyGroupsShow.do?gid=32&page=1&keyword='+keyVal+'&sort='+sortVal+'&filter='+filterVal+'#groupsearch'
alert(locationUrl);
location.href=locationUrl;
}
//]]>
</script>