首页 > 开发 > AJAX > 正文

Baidu Musicbox 用到的ajax代码

2024-09-01 08:29:40
字体:
来源:转载
供稿:网友
var names;
var Cs, St;
var rorw="";
var lrcT;

function getname(songname){
    if(songname==""){
        names=$("name").value;
    }else{
        names=songname;
    }
    geturl();
}
function geturl(){
    AJAXCALL("inc/songurl.asp?type=url1&keyword="+names,"musiclist","isXML=true");
    addbox(names);
}
function top(){
    AJAXCALL("inc/songlist.asp?ac=new","toplist","isXML=true");
}
function toplist(doc){
    var items=getElementsByClass(doc,"item");
        var linker=new Array();
        var linkers=new Array();
    var tmp="<ul>";
    for(var i=0;i<items.length;i++){
                if(getTagValue(items[i], "singer")=="")
                {
                  linker[i]="";
                  linkers[i]="";   
                }
                else
                {
                  linker[i]="("+getTagValue(items[i], 'singer').replace(/ /g," ")+")";
                  linkers[i]=" "+getTagValue(items[i], 'singer').replace(/ /g," ");
                }
        var d=i+1;
        tmp+='<li>'+d+'. <a href=javascript:getname("'+getTagValue(items[i], 'songname').replace(/ /g," ")+linkers[i]+'") title="'+getTagValue(items[i], 'songname').replace(/ /g," ")+linker[i]+'">'+getTagValue(items[i], 'songname').replace(/ /g," ")+linker[i]+'</a></li>';
    }
    tmp+="</ul>";
    $("toplist").innerHTML=tmp;
}
function s2(){
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表