#2
skybirdzw2008-10-28 12:41
|
用XMLHTTP做一个静态分页,点击生成后却出现错误,弹出一警告窗口,是alert(xmlhttp.responseText)里的内容!
对HTML_proclass.asp文件单独测试没有问题,请问我的问题到底出现在哪啊??? 郁闷了一上午了!
manage_class_html.asp内容如下:
<!--#include file="../inc/conn.asp"-->
<%
smallid=request.QueryString("smallclassid")
num=9
sql="select * from [product] where smallid=4 order by proid desc"
set rs=Server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
rs.PageSize = num
counts=rs.PageCount
rs.close
set rs=nothing
%>
<script>
function sub2()
{
var test;
var xmlhttp;
try{
xmlhttp=new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
try{
xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
try{
xmlhttp=new XMLHttpRequest();
}catch(e){}
}
}
for(i=1;i<=<%=counts%>;i++){
xmlhttp.onreadystatechange=function(){
if (4==xmlhttp.readyState){
if (200==xmlhttp.status){
submit.value="生成成功";}
else{alert(xmlhttp.responseText);}
}
}
xmlhttp.open("post","HTML_proclass.asp",false);
xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xmlhttp.send("page="+i+"&num="+<%=num%>+"&sid="+<%=smallid%>);}
}
</script>
<input type="submit" name="submit" value="生成" onclick="sub2();" />
万分感谢!