替换了空白的可能出现空白问题在这两段代码里边 这两个应该是显示礼物的,但是有脚本错误。我看不明白,希望有人能解决。
J(document).ready(function(){
showList( -1 , 0 );
});
function showList(tid,st){
J('#gift_list').html("<p><img src=\"gift/js/loading.gif\" align=\"absmiddle\">正在获取数据,请稍候...</p>");
J.ajax({
type: "POST",
url: "gift.php?do=list&num="+Math.round(Math.random()*10000),
data: "t="+tid+"&s="+st,
success: function(msg){
J('#gift_list').html("");
J('#gift_page').html("");
if(msg == "err_null_rs"){
alert("通信错误");
}else{
var list = eval('('+unescape(msg)+')');
var num = list.gift.length;
var maxtype = <!--{eval echo count($giftlist[category])}-->;
for(var i=0;i<maxtype;i++){
J('#type_'+i).css("font-weight","normal");
J('#type_all').css("font-weight","normal");
}
J('#type_'+list.type).css("font-weight","bold");
for(i=0;i<num;i++){
var newli = "<li style=\"width:100px;height:130px;float:left;\"><img src=\"gift/gift_model/image/"+list.gift.src+"\" width=\"64\" height=\"64\" alt=\""+list.gift.name+"\" ><p><input type=\"radio\" name=\"giftitem\" align=\"middle\" value=\""+list.gift.gid+"\">"+list.gift.name+"<br><span>花费:"+list.gift.cost+"分</span></p></li>";
J('#gift_list').append(newli);
}
if(list.pages > 1){
var page = '';
for(i=0;i<(list.pages);i++){
if(list.curp == i){
page = page + "<a href='#' style=\"margin: 0 2px; padding: 1px 5px; line-height: 26px;\" onclick=\"showList( "+tid+" , "+(list.perpage*i)+" )\"><strong>"+(i+1)+"</strong></a>";
}else{
page = page + "<a href='#' style=\"margin: 0 2px; padding: 1px 5px; border: 1px solid #DDD;line-height: 26px;\" onclick=\"showList( "+tid+" , "+(list.perpage*i)+" )\">"+(i+1)+"</a>";
}
}
J('#gift_page').html(page);
}
}
}
});
} |