`

JS--大批量数量处理(分批续传)

 
阅读更多

<html>
<head>
<%
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
%>
<script src="<%=request.getContextPath()%>/boss/common/jquery-1.2.6.js"></script>

 <script type="text/javascript">

	<!--
		var totalData="12345678901234567890abcdefghi";
		var curIndex=0;
		var totalLeng=totalData.length;
		var dealLeng=3;
		$(document).ready(function(){		
			$("#a").load(function(){//IFRAME加载完毕后回调该方法
				doTransfer();
			});
		});
		function doTransfer(){
			if(curIndex==-1){
				return;
			}else{
				if(curIndex>=totalLeng){
					//处理完毕,返回
					a.location="http://localhost:8080/com/boss/common/t.jsp?data=-1";
					curIndex=-1;
			    }else{
			    	//处理curIndex=>totalLeng
					a.location="http://localhost:8080/com/boss/common/t.jsp?data="+totalData.substring(curIndex,curIndex+dealLeng);
					curIndex+=dealLeng;
				}
			}
		}	
	//-->

 

 </script>
</head>
<body  onload="doTransfer()">
 <iframe  id="a"></iframe>
</body>
</html>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics