function history_show()
{
var history_info=hgetCookie("history_info");
var content="";
if(history_info!=null){
history_arg=history_info.split("_splitchar_");
for(i=0;i<=15;i++){
if(history_arg[i]!="null"){
var wlink=history_arg[i].split("+");
content+=("<a href='"+wlink[1]+"' target='_blank'>"+wlink[0]+"</a>");
}
document.getElementById("historyurl").innerHTML=content;
}
}
else{document.getElementById("historyurl").innerHTML="您没有任何浏览纪录";}
} if(history_arg[i]!="null")这句总是报不是对象或为空,我取i的值发现当i=7时,会报NaN可是用if(i="NaN")或if(isNaN(i)==true)或if(i!=i)都无法判断这个NaN值从而跳出循环,实在是憋曲,到底哪儿错了?注:history_arg不一定有15个值,可能会少一些。
{
var history_info=hgetCookie("history_info");
var content="";
if(history_info!=null){
history_arg=history_info.split("_splitchar_");
for(i=0;i<=15;i++){
if(history_arg[i]!="null"){
var wlink=history_arg[i].split("+");
content+=("<a href='"+wlink[1]+"' target='_blank'>"+wlink[0]+"</a>");
}
document.getElementById("historyurl").innerHTML=content;
}
}
else{document.getElementById("historyurl").innerHTML="您没有任何浏览纪录";}
} if(history_arg[i]!="null")这句总是报不是对象或为空,我取i的值发现当i=7时,会报NaN可是用if(i="NaN")或if(isNaN(i)==true)或if(i!=i)都无法判断这个NaN值从而跳出循环,实在是憋曲,到底哪儿错了?注:history_arg不一定有15个值,可能会少一些。
...
}
danica7773老师的句子顺利通过,不过最后多了一个null的链接,能再指点一下吗?