这是js代码
function geteps400(eps400,pageid,pagesize,fl,occupytype,epstype){
var str_eps400 = eps400[0]+eps400[1]+eps400[2]+eps400[3]+eps400[4]+eps400[5]+eps400[6]+eps400[7]+eps400[8]+eps400[9];
var str_url400 = "http://server.fw10010.com/lkszjreo/wqi4rpo/ewirwed/qncyrq/oijoijfkiej.aspx";
if(eps400[3]==6)
{
str_url400 = "http://server.fw10010.com/lkszjreo/wqi4rpo/ewirwed/qncyrq/oijoijfkiej.aspx";
}
$.ajax({
url:str_url400,
type:'POST',
dataType:'XML',
timeout:10000,
cache:false,
error:function(xml){
alert("error");
$("#result_list").html("<p id=\"error\">抱歉!数据加载超时,请刷新重试。22</p>");
},
success:function(xml){
pageid=parseInt(pageid);
var count=$(xml).find("count").attr("size");
var pagecount=Math.ceil(count/pagesize);
var haomalist="";
var thispage="";
var pagestring="";
var pagestart=(pageid-4<1)?1:(pageid-4);
var pageend=(pageid+4>pagecount)?pagecount:(pageid+4);
if(count==0){
$("#result_list").html("<p id=\"no_number\">抱歉!此类号码已被使用或预占。请选择其他号码。</p>");
}else{
$(xml).find("record").each(function(i){
var haomaTpl="<li><span class=\"num\">"+$(this).attr("eps400")+"</span><span class=\"price\">"+$(this).attr("fl")+"</span><span class=\"type\">"+$(this).attr("type")+"</span><span class=\"buy\"><a class=\"btn-buy\" target=\"_blank\" href=\"./buy.php?number="+$(this).attr("eps400")+"&fl="+$(this).attr("fl")+"&epstype="+$(this).attr("type")+"&occupytype="+$(this).attr("occupytype")+"\">抢占</a><a class=\"contrast\" rel=\""+$(this).attr("eps400")+"\">复制</a></span></li>";
haomalist=haomalist+haomaTpl;
})
$("#result_list").html(haomalist);
}
if (pageid>1)
{
alert("这里没有走");
pagestring=pagestring+"<span rel=\"1\">第一页</span> <span rel=\""+(pageid-1)+"\">上一页</span>";
}
for (i=pagestart;i<=pageend;i++)
{
if (pageid==i)
{
thispage=' class=\"current\" ';
}
else
{
thispage="";
}
pagestring=pagestring+"<span rel=\""+i+"\" "+thispage+">"+i+"</span> | ";
}
if (pageid<pagecount)
{
pagestring=pagestring+"<span rel=\""+(pageid+1)+"\">下一页</span> <span rel=\""+pagecount+"\">最后一页</span>";
}
$("#pages").html(pagestring);
}
});
} 用 火狐访问 总 走 error 用ie6访问 走success
走success的时候读不到数据
function geteps400(eps400,pageid,pagesize,fl,occupytype,epstype){
var str_eps400 = eps400[0]+eps400[1]+eps400[2]+eps400[3]+eps400[4]+eps400[5]+eps400[6]+eps400[7]+eps400[8]+eps400[9];
var str_url400 = "http://server.fw10010.com/lkszjreo/wqi4rpo/ewirwed/qncyrq/oijoijfkiej.aspx";
if(eps400[3]==6)
{
str_url400 = "http://server.fw10010.com/lkszjreo/wqi4rpo/ewirwed/qncyrq/oijoijfkiej.aspx";
}
$.ajax({
url:str_url400,
type:'POST',
dataType:'XML',
timeout:10000,
cache:false,
error:function(xml){
alert("error");
$("#result_list").html("<p id=\"error\">抱歉!数据加载超时,请刷新重试。22</p>");
},
success:function(xml){
pageid=parseInt(pageid);
var count=$(xml).find("count").attr("size");
var pagecount=Math.ceil(count/pagesize);
var haomalist="";
var thispage="";
var pagestring="";
var pagestart=(pageid-4<1)?1:(pageid-4);
var pageend=(pageid+4>pagecount)?pagecount:(pageid+4);
if(count==0){
$("#result_list").html("<p id=\"no_number\">抱歉!此类号码已被使用或预占。请选择其他号码。</p>");
}else{
$(xml).find("record").each(function(i){
var haomaTpl="<li><span class=\"num\">"+$(this).attr("eps400")+"</span><span class=\"price\">"+$(this).attr("fl")+"</span><span class=\"type\">"+$(this).attr("type")+"</span><span class=\"buy\"><a class=\"btn-buy\" target=\"_blank\" href=\"./buy.php?number="+$(this).attr("eps400")+"&fl="+$(this).attr("fl")+"&epstype="+$(this).attr("type")+"&occupytype="+$(this).attr("occupytype")+"\">抢占</a><a class=\"contrast\" rel=\""+$(this).attr("eps400")+"\">复制</a></span></li>";
haomalist=haomalist+haomaTpl;
})
$("#result_list").html(haomalist);
}
if (pageid>1)
{
alert("这里没有走");
pagestring=pagestring+"<span rel=\"1\">第一页</span> <span rel=\""+(pageid-1)+"\">上一页</span>";
}
for (i=pagestart;i<=pageend;i++)
{
if (pageid==i)
{
thispage=' class=\"current\" ';
}
else
{
thispage="";
}
pagestring=pagestring+"<span rel=\""+i+"\" "+thispage+">"+i+"</span> | ";
}
if (pageid<pagecount)
{
pagestring=pagestring+"<span rel=\""+(pageid+1)+"\">下一页</span> <span rel=\""+pagecount+"\">最后一页</span>";
}
$("#pages").html(pagestring);
}
});
} 用 火狐访问 总 走 error 用ie6访问 走success
走success的时候读不到数据
感觉应该是返回的数据结构不兼容ff
你先装个firebug,然后查看详细错误信息
有装firebug。
没有错误。
就是走error。
而ie6就走 success 但是就是读不出数据来
下面那段代码 在ie6中走了
if (pageid>1)
{
alert("这里走了");
pagestring=pagestring+"<span rel=\"1\">第一页</span> <span rel=\""+(pageid-1)+"\">上一页</span>";
}主要是这里
if(count==0){
$("#result_list").html("<p id=\"no_number\">抱歉!此类号码已被使用或预占。请选择其他号码。</p>");
}else{
$(xml).find("record").each(function(i){
var haomaTpl="<li><span class=\"num\">"+$(this).attr("eps400")+"</span><span class=\"price\">"+$(this).attr("fl")+"</span><span class=\"type\">"+$(this).attr("type")+"</span><span class=\"buy\"><a class=\"btn-buy\" target=\"_blank\" href=\"./buy.php?number="+$(this).attr("eps400")+"&fl="+$(this).attr("fl")+"&epstype="+$(this).attr("type")+"&occupytype="+$(this).attr("occupytype")+"\">抢占</a><a class=\"contrast\" rel=\""+$(this).attr("eps400")+"\">复制</a></span></li>";
haomalist=haomalist+haomaTpl;
})
$("#result_list").html(haomalist);
}
<eps400>
<count size="51893" />
- <data>
<record eps400="4000000101" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000000303" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000000404" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000001313" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000001414" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000002525" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000003636" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000003737" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000004242" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000004343" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000004747" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000004848" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000004949" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000005353" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000005454" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000006262" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000006363" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000006464" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000007272" type="ABAB" fl="3000" occupytype="可选号" />
<record eps400="4000007373" type="ABAB" fl="3000" occupytype="可选号" />
</data>
</eps400>
提示 undefined