IE6 和 IE8下翻页功能的失效差别问题

最新发现一个BUG,翻页在IE8下好好的;在IE6下出问题(点击页面不动,可是页面却记住了页码的标识)。 javascript

<div class="page">
    <jsp:include page='/common/page_new.jsp'/>
</div>

page_new.jsp html

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"  %>
<c:if test="${fn:length(page.list)>0}">
      <input name="navPageNo" id="navPageNo" type="hidden" value="${page.currentPage}" /> 
       <div class="fl"> 每页显示: <select style="width:40px; height:20px;"  onchange="subForm('1')" name="pagecount"><option value="5" <c:if test="${page.count eq '5'}">selected</c:if>>5</option><option value="10" <c:if test="${page.count eq '10'}">selected</c:if>>10</option><option value="15" <c:if test="${page.count eq '15'}">selected</c:if>>15</option></select>&nbsp;共${page.total}条</div>
      <div class="fr page_right">

        <c:if test="${page.hasPreviousPage}">
            <a href="javascript:void(0)" class="onepage" title="上一页" onclick=subForm('${page.currentPage-1}')></a>
        </c:if>
         <c:forEach var="x"
            begin="${(page.currentPage-4)<1?1:(page.currentPage-4)}"
            end="${(page.currentPage+5)>page.pageCount?(page.pageCount):(page.currentPage+5)}"
            step="1">
            <c:if test="${x!=page.currentPage}">
                <a href="javascript:void(0)" class="number"  onclick=subForm('${x}')>${x}</a>
            </c:if>
            <c:if test="${x==page.currentPage}">
                 <a href="javascript:void(0)" class="number selectpage">${x}</a>
            </c:if>
        </c:forEach>
        <c:if test="${page.hasNextPage}">
             <a href="javascript:void(0)" class="nextpage" title="下一页" onclick =subForm('${page.currentPage+1}') ></a>
        </c:if>
      </div>
  

</c:if>
	<script type="text/javascript">
function subForm(toPageNum){
     
     var f = document.mainform;
      f.elements["navPageNo"].value=toPageNum;
       
     
     f.submit();
}
	</script>
缘由IE6下
<A href="javascript:void(0)">点击</a>点击连接后不会回到网页顶部
<A href="#">点击</a>  点击后会回到网面顶部
再也不执行onclick事件。

只需将href="javascript:void(0)"替换成href="#" 。 java

2: jsp

相关文章
相关标签/搜索